HTML DOM OptionGroup 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 attribute

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

Standard Attributes and Events

The OptionGroup object supports standardsPropertiesAndEvents.

Related Pages

HTML Reference Manual:HTML <optgroup> Tag