option disabled Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:option

Description

The disabled attribute is a boolean attribute to set if an option should be disabled.

In XHTML, the disabled attribute must be defined as <option disabled="disabled">.

The following code shows how to create A drop-down list with one disabled option:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<select>
  <option value="a" disabled>A</option>
  <option value="java">Java</option>
  <option value="python">Python</option>
  <option value="sql">SQL</option>
</select><!--from   www  .  jav a 2  s.  c  o m-->

</body>
</html>

Related Tutorials