option label Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:option

Description

The label attribute sets a shorter version of an option which will be displayed in the drop-down list.

Attribute Values

Value Description
text A shorter version for the option

The following code shows how to Use of the label attribute in <option> elements:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials