HTML and CSS Reference
In-Depth Information
However, using the value attribute in this manner is somewhat inappropriate, because the
purpose of the attribute is not to supply instructions for the field's use but rather to supply
a potential value for the user to submit to the server. HTML5 introduces the placeholder
attribute to use instead for this duty:
<input type="text" name="firstname" id="firstname"
placeholder="Enter your name here">
HTML5 also introduces the autofocus attribute, which when placed on a field should
cause a supporting browser to immediately focus this field once the page is loaded:
<label> Search: <input type="search" name="query"
id="searchBox" autofocus></label>
Also under HTML5, it should be possible to advise the browser to display the
autocomplete suggestions provided for fields if similar field names have been used in the
<input type="text" name="firstname" id="firstname"
placeholder="Enter your name here" autocomplete>
Interestingly, this particular attribute has been supported in Internet Explorer browsers for
some time.
Other form improvements likely will be added to the HTML5 specification. The aim
here is to give you a sense of the changes the HTML5 specification intends to bring to
Web-based data collection.
Emerging Elements and Attributes to Support Web Applications
A key theme of the HTML5 specification is the emphasis on supporting Web applications.
A number of elements and attributes have been introduced in the specification to continue
the migration from Web pages to Web applications. However, most of these features are not
implemented in browsers, and some are controversial enough that their inclusion in later
versions of the specification is far from certain. Thus, you are warned that the elements
presented here should be considered only illustrative of the kinds of changes HTML5 tends
to encourage and that some of them may be changed or removed. As of yet, no native
implementation of these elements exists, so we simulated their possible renderings using
a JavaScript library. Given the speculative nature of these new elements, you should consult
the specification for the latest information on support.
menu Element Repurposed
One element that will be implemented in browsers but might not perform the actions defined
in HTML5 is the menu element. Traditionally, this element was supposed to be used to create
a simple menu for choices, but most browsers simply rendered it as an unordered list:
<menu type="list" id="oldStyle">
<li> Item 1 </li>
<li> Item 2 </li>
Search WWH ::

Custom Search