W3cubDocs

/Web APIs

HTMLOptGroupElement: disabled property

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The disabled property of the HTMLOptGroupElement interface is a boolean value that reflects the <optgroup> element's disabled attribute, which indicates whether the control is disabled.

When disabled, the <option> element descendants of the <optgroup> element are unusable, un-clickable, and unselectable. These disabled <option>s will match the :disabled selector, even if their disabled property value is false.

Value

A boolean value.

Examples

const optionGroup = document.getElementById("groupB");
console.log(optionGroup.disabled);
optionGroup.disabled = true;

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
disabled 1 12 1 ≤12.1 7
3–7The property can be set, but has no effect (see bug 227042).
18 4 ≤12.1
1The property can be set, but has no effect (see bug 227042).
1.0 4.4
1The property can be set, but has no effect (see bug 227042).

See also

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptGroupElement/disabled