HTML <select> Tags

Source: Internet
Author: User

Definition and usage

The Select element creates a single-or multiple-selection menu.

The <option> tags in the <select&> element are used to define the options available in the list.

Differences between HTML 4.01 and HTML 5

HTML5 has added some new properties.

Tips and Comments:

Tip: The Select element is a form control that can be used to accept user input in a form.

Property

The new property in the NEW:HTML5.

Properties value Description
Autofocus Autofocus Specifies that the text area automatically receives focus after the page is loaded.
Disabled Disabled Specifies that the drop-down list is disabled.
Form form_id Specifies one or more forms to which the text area belongs.
Multiple Multiple Specifies that multiple options can be selected.
Name Name Specifies the name of the drop-down list.
Required Required The specified text area is required.
Size Number Specifies the number of visible options in the drop-down list.
Global Properties

The <select> tag supports global properties in HTML.

Event Properties

The <select> tag supports event properties in HTML.

Try it yourself-more examples
Simple drop-down list
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
This example shows how to create a simple drop-down list with preselected values. (Translator Note: Preselected values refer to pre-specified preferences.) )

HTML <select> Tags

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.