disabled (HTML attribute)

Depr. Version
No HTML 3.02
Browser support (more…)
IE8+ FF1+ SA3.1+ OP9.2+ CH2+
Full Full Full Full Full




The disabled attribute stops the user from interacting with specific options in the select list. When using the up and down arrow keys, users will simply skip over any disabled options; nor can they click on disabled options with the mouse.

The most likely application for this attribute is to disable certain choices in the list until some other condition has been met (until a checkbox is checked, for example, which widens the potential choices the user may make). At this point, JavaScript would be required to removed the "disabled" values, making those options selectable. Figure 1 shows the effect of disabling specific option elements.

Figure 1. A select list in which two options disabled A select list with two options disabled


The disabled attribute stops the "Cabbage" and "Lettuce" option elements from being used:
  <label for="favoritefood">Favorite food</label>
  <select name="favoritefood" id="favoritefood">
    <option disabled="disabled">Cabbage</option>
    <option disabled="disabled">Lettuce</option>


The only value that disabled can take "disabled".


Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
None None None Full Full Full Full Full Full None None Full Full Full Full Full Full

This attribute is poorly supported and should not be relied upon.

User-contributed notes

There are no comments yet.

Related Products