Enter HTML5 entry to proficient:<option> label

Source: Internet
Author: User
Keywords tags HTML5 Getting started to master

"Reprint please retain the integrity of the content of the Wind network article, if you do not comply with this principle, we will retain the right to pursue legal responsibility"

<option> Label

Definitions and usage

<option> label defines an option in the Drop-down list.

Differences between HTML 4.01 and HTML 5

,<option> tags are also used in the new element <datalist> in HTML 5.

Tips and comments

Wind Network (www.ithov.com) Note:<option> tags can be used without any attributes, but often require http://www.aliyun.com/zixun/aggregation/9541.html " >value property that defines the data that is sent to the server.

Wind Network (www.ithov.com) Note: Please use in conjunction with <select> or <datalist> tags. ,<option> tags are meaningless elsewhere.

Example

<select>
<option value= "Volvo" >Volvo</option>
<option value= "Saab" >Saab</option>
<option value= "Opel" Selected= "selected" >Opel</option>
<option value= "Audi" >Audi</option>
</select>

Property

Property Value Description 4 5 disabled Disabled Specify that this option should be disabled on first load. 4 5 Label text defines the callouts used when using &lt;optgroup&gt;. 4 5 Selected selected the specified option (when first displayed in the list) is displayed as selected. 4 5 Value text defines the option values to be sent to the server. 4 5

Standard properties

Class, Contenteditable, ContextMenu, dir, draggable, id, irrelevant, lang, ref, Registrationmark, TabIndex, template, For a complete description of the title, visit the standard properties in HTML 5.

Event Properties

Onabort, onbeforeunload, onblur, onchange, onclick, OnContextMenu, ondblclick, Ondrag, Ondragend, OnDragEnter, OnDragLeave, OnDragOver, ondragstart, OnDrop, OnError, onfocus, onkeydown, onkeypress, onkeyup, onload, OnMessage, OnMouseDown, OnMouseMove, onmouseover, onmouseout, onmouseup, OnMouseWheel, OnResize, Onscroll, Onselect, onsubmit, OnUnload for a complete description, visit the event properties in HTML 5.

Tiy instance

Simple Drop-down List

<html>
<body>
<form>
<select name= "Cars" >
<option value= "Volvo" >Volvo</option>
<option value= "Saab" >Saab</option>
<option value= "Fiat" >Fiat</option>
<option value= "Audi" >Audi</option>
</select>
</form>
</body>
</html>

This example shows how to create a simple drop-down list box in an HTML page. The Drop-down list box is an optional list.

Another drop-down list

<html>
<body>
<form>
<select name= "Cars" >
<option value= "Volvo" >Volvo</option>
<option value= "Saab" >Saab</option>
<option value= "Fiat" Selected= "selected" >Fiat</option>
<option value= "Audi" >Audi</option>
</select>
</form>
</body>
</html>

This example shows how to create a simple drop-down list with preselection values. (Note: Preselection values refer to predetermined preferences.) )

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.