HTML option Tag
HTML option Tag
The option tag defines an option in a select list. The option elements go inside a select, optgroup, or datalist element. The option tag can be used without any attribute. However, in case of form submission we have to specify its value attribute and its value.
Attribute Explanation:-
Attribute | Value | Description |
---|---|---|
disabled | disabled | Specifies that an option should be disabled |
label | text | Specifies a shorter label for an option |
selected | selected | Specifies that an option should be pre-selected when the page loads |
value | text | Specifies the value to be sent to a server. |
Syntax:-
Its syntax is:- < option >