About HTML5 entry to mastery: HTML5 form elements

Source: Internet
Author: User
Keywords HTML5 form elements door to master

New FORM element for HTML 5:

HTML 5 owns several elements and attributes that involve a form.

This chapter describes the following new form elements:

DataList
Keygen
Output

Browser support

Input type IE Firefox http://www.aliyun.com/zixun/aggregation/10963.html ">opera Chrome Safari DataList no no 9.5 No no no keygen no no 10.5 3.0 No output no no no 9.5 no no

DataList element

The DataList element sets the list of options for the input field.

The list is created from the option element within DataList.

To bind DataList to an input field, refer to the DataList ID with the list property of the input field:

Instance

Webpage: <input type= "url" list= "url_list" name= "link"/>
<datalist id= "Url_list" >
<option label= "W3school" value= "http://www.W3School.com.cn"/>
<option label= "Google" value= "http://www.google.com"/>
<option label= "Microsoft" value= "http://www.microsoft.com"/>
</datalist>

Try it yourself, the code is as follows:

<! DOCTYPE html>
<html>
<body>
<form action= "/example/html 5/demo_form.asp" method= "Get" >
Webpage: <input type= "url" list= "url_list" name= "link"/>
<datalist id= "Url_list" >
<option label= "W3school" value= "http://www.w3school.com.cn"/>
<option label= "Google" value= "http://www.google.com"/>
<option label= "Microsoft" value= "http://www.microsoft.com"/>
</datalist>
<input type= "Submit"/>
</form>
</body>
</html>

Tip: Option element always sets the Value property.

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.