HTML <optgroup> disabled attribute
HTML <optgroup> tag
Example
A disabled option group:
<select>
<optgroup label="German Cars" disabled="disabled">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
|
Try it yourself!
|
Definition and Usage
The disabled attribute specifies that an option group should be disabled.
A disabled option group is unusable and un-clickable.
The disabled attribute can be set to keep a user
from selecting from the option group until some other condition has been met (like selecting a
checkbox, etc.). Then, a JavaScript is required to remove the disabled value,
and make the option group selectable.
Browser Support

The disabled attribute is supported by all major browsers, except Internet Explorer.
Note: Not supported in Safari 2.0 or earlier versions. Supported in IE
8 (beta) and newer versions.
Syntax
<optgroup disabled="value">
|
Attribute Values
Value |
Description |
disabled |
Disables the option group |
HTML <optgroup> tag
 |
|
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate is for developers who want to document their knowledge of JavaScript and the HTML DOM.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).
|
|