HTML DOM Option Group object

OptionGroup object

The OptionGroup object represents the HTML <optgroup> element.

Access OptionGroup object

You can access the <optgroup> element by using getElementById():

var x = document.getElementById("myOptgroup");

Try it yourself

Create OptionGroup object

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

var x = document.createElement("OPTGROUP");

Try it yourself

OptionGroup object property

Properties Description
disabled Set or return whether the option group is disabled.
label Set or return the label property value of the option group.

Standard properties and events

The OptionGroup object supports standardsPropertiesandEvents.

Related pages

HTML reference manual:HTML <optgroup> tag