Java Reference
In-Depth Information
Creates a control for entering a date
consisting of a week‐year number and a week
number with no time zone.
The year and week number
( 2014‐W29 ).
week
Unfortunately, some of the new input types are not supported by any browser, and some are only
supported by a few. Many of the supported input types exhibit inconsistent behavior between
browsers. In short, if you plan on using any of these new input types, be sure to test your page in all
modern browsers.
HTML5 also brings several new attributes to <input/> elements, all of which are
accessible as properties of the element object. The following table lists just some of these
attributes.
tYpe
desCription
Specifies that the value of the control can be automatically completed by the
browser.
autocomplete
Determines if the control should have focus when the page loads.
autofocus
The ID of the associated form. If specified, the control can be placed anywhere in
the document. If not specified, the control can only reside within the form.
form
Specifies the maximum number of characters the user can enter for text , email ,
search , password , tel , and url types.
maxLength
A regular expression that the control's value is checked against.
pattern
Displays a hint to the user of what can be entered in the field.
placeholder
Specifies that the user must fill in a value for the field before submitting the form.
required
In addition to these properties, HTML5 specifies three unique properties/attributes for the range
type:
min : The minimum value of the slider
max : The maximum value of the slider
step : The increment between values
New Input Types
trY it out
Let's look at an example of the number and range input types, as well as the input event. Open your
text editor and type the following:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Chapter 11: Example 10</title>
</head>
Search WWH ::




Custom Search