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