OptionGroup disabled Property

❮ OptionGroup Object

Example

Disable an option-group:

document.getElementById("myOptgroup").disabled = true;
Try it Yourself »

Description

The disabled property sets or returns whether an option-group is disabled, or not.

A disabled element is unusable and un-clickable. Disabled elements are usually rendered in gray by default in browsers.


Browser Support

Property
disabled Yes Yes Yes Yes Yes


Syntax

Return the disabled property:

optiongroupObject.disabled

Set the disabled property:

optiongroupObject.disabled = true|false

Property Values

Value Description
true|false Specifies whether an option-group should be disabled or not
  • true - The option-group is disabled
  • false - Default. The option-group is not disabled

Technical Details

Return Value: A Boolean, returns true if the option-group is disabled, otherwise it returns false

More Examples

Example

Find out if an option-group is disabled or not:

var x = document.getElementById("myOptgroup").disabled;
Try it Yourself »

Related Pages

HTML reference: HTML <optgroup> disabled attribute


❮ OptionGroup Object
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.