YouTip LogoYouTip

Prop Optgroup Disabled

# OptionGroup disabled Property [![Image 8: OptionGroup Object Reference](#) OptionGroup Object](#) ## Example Disable an option-group: document.getElementById("myOptgroup").disabled=true; Output: BMW Mercedes Volvo Saab Koenigsegg [Try it Β»](#) * * * ## Definition and Usage The disabled property sets or returns whether an option-group is disabled. A disabled element is unusable and unclickable. Typically, disabled elements are rendered gray in browsers by default. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The disabled property is supported in all major browsers. * * * ## Syntax Return the disabled property: _optiongroupObject_.disabled Set the disabled property: _optiongroupObject_.disabled=true|false ## Property Values | Value | Description | | --- | --- | | true|false | Specifies whether the option-group is disabled. * 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 false. | | --- | * * * ## More Examples ## Example Check if an option-group is disabled: var x = document.getElementById("myOptgroup").disabled; document.getElementById("demo").innerHTML=x; The _x_ output will be: true [Try it Β»](#) * * * ## Related Articles HTML Reference: (#) * * OptionGroup Object](#)
← Prop Optgroup LabelDom Obj Optgroup β†’