HTML5 form-form analysis

Source: Internet
Author: User

Currently, html5 standards are still under development. Different browsers have limited support for HTML5 features. Chrome and Opera have better support for forms. This example runs normally on chrome and Opera. The recommended version is the highest, as shown below:
 
 
 
 
What new element types and functions are used in this form?
 
 
Type
We are familiar with text, password, submit, and reset.
In this example, the new types of email (email), range (number), number (number), date (date), and url (url) assigned by the input HTML5 are used)
For details about the type, refer to this site: creating a brand new HTML5 form
 
Placeholder (placeholder in the input box)
A default input prompt text, we need to implement or simple js Code through event properties, everything will become so simple in html5, just add placeholder = "input box placeholder ", you can achieve the desired effect.
 
Datalist (Option List)
Explanation given by w3c:
<Datalist> List of tag definition options. Use this element with the input element to define the possible input values.
Datalist and its options are not displayed. It is only a list of valid input values.
Use the list attribute of the input element to bind datalist.
 
<Input id = "myCar" list = "cars"/>
<Datalist id = "cars">
<Option value = "BMW">
<Option value = "Ford">
<Option value = "Volvo">
</Datalist>
However, only operabrowser supports this attribute.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.