English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTML option disabled Attribute
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 ‹/›
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.
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.
None.
In XHTML, attribute abbreviations are prohibited, and the disabled attribute must be defined as <option disabled="disabled">.
<option disabled>HTML <option> Tag