HTML5The input tag adds a lot of properties and is a very exciting thing to do, with a simple property to get past the complexJS Verification。 The added attributes of input make the division of HTML and JS more explicit and comfortable to use.
Let's take a look at the new properties of input:
New Attribute one: Autoconmplete
The autoconmplete can be assigned on or off. When on, the browser can automatically store user-entered content. When the user returns to the page that has already filled in the value, the browser can automatically fill in the corresponding input box with the value written by the user.
Many web sites now implement this feature, but the basic is to use PHP to achieve. With this attribute, there is no doubt that many front-end and background traffic and workload can be reduced.
New Attribute two: Autofocus
Autofocus can be assigned to autofocus, that is, when the page load is completed automatically focus on the input tag, natural type= "hidden" when it is not available. This is also a more common effect, so far the implementation method is to use JS. The focus was performed when the page was loaded, and now it's done with a property.
As you can imagine, a page at most only one input tag will set autofocus, otherwise it will not achieve the desired effect. Because it is impossible for colleagues to focus on two input.
New attribute three: Required
Input has a powerful new attribute that eliminates the hassle of validation. You can assign a value of required.
For example, user registration page user name and password are required, as long as a required can be set. In the past, JS is required to verify or verify the background.
Note: Here the required attribute is required for the user to fill in, so the type is button, submit, reset, image, etc. does not require the user to fill in the selection is not possible to use this property.
New attribute four: Placeholder
This new property is also very useful, used in the type= text email and so on, prompt the user to enter information format or content, and so on. This effect is also required in the previous JS to achieve. is a more common effect:
Name:
Address:
HTML5 Input New Property
New attribute five: New List property---associative box effect
This property is similar to the Baidu search box that kind of Lenovo box effect, but also a very useful property.
Note the features used from this attribute: the corresponding DataList tag is required; DataList child label option supports both value and lable two properties; The list's property value is the same as the DataList ID.
Use Example (opera support)
HTML5 Input New Property