English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Online-Tools

Referenzhandbuch

: <progress> Tag

HTML option disabled Attribute

 HTML <option> Tag

Der disabled-Attribute ist ein boolescher Attribute. Wenn er vorhanden ist, wird angegeben, dass eine Option deaktiviert werden soll. Deaktivierte Optionen sind nicht verfügbar und können nicht geklickt werden.

Online-Beispiel

Beispiel
<!DOCTYPE html>
<html>
<head> - <title>HTML:<option> disabled Attribute3codebox.com)</title>
</head>
<body>
<select>
  <option value="PHP" disabled>PHP</option>
  <option value="HTML">HTML</option>
  <option value="C++">C++</option>
  <option value="GOLANG">GOLANG</option>
  <option value="JAVA">JAVA</option>
</select>
</body>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the disabled attribute.

Note:Internet Explorer 7 And earlier versions do not support the disabled attribute of the <option> tag.

Definition and Usage

The Disabled attribute is a boolean attribute.

If present, it specifies that an option should be disabled.

Disabled options are not available and cannot be clicked.

You can set the Disabled property to prevent the user from selecting the option until other conditions are met (such as checking a checkbox, etc.). Then, JavaScript is needed to remove the disabled value and make the option selectable.

HTML 4.01 With HTML5Differences

None.

Differences between HTML and XHTML

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

Syntax

<option disabled>
 HTML <option> Tag