HTML CSS examples for HTML Tag:option
The label attribute sets a shorter version of an option which will be displayed in the drop-down list.
Value | Description |
---|---|
text | A shorter version for the option |
The following code shows how to Use of the label attribute in <option> elements:
<!DOCTYPE html> <html> <body> <select> <option label="V">V long desc</option> <option label="S">S long desc</option> <option label="M">M long desc</option> <option label="A">A long desc</option> </select><!-- w w w .j ava 2s. c o m--> </body> </html>