HTML DOM OptionGroupObject


OptionGroup Object

The OptionGroup object represents an HTML <optgroup> element.

Access an OptionGroup Object

You can use getElementById() to access an <optgroup> element:

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

Create an OptionGroup Object

You can use the document.createElement() method to create an <optgroup> element:

var x = document.createElement("OPTGROUP"); Try it Yourself

OptionGroup Object Properties

Property Description
disabled Sets or returns whether the option group is disabled.
label Sets or returns the value of the label attribute of the option group.

Standard Properties and Events

The OptionGroup object also supports standardPropertiesandEvents。


Related Articles

HTML Reference Manual:HTML <optgroup> Tag

Other Extensions