Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML DOM Option Group object


May 06, 2021 JavaScript with HTML DOM Reference book


Table of contents


HTML DOM Option Group object


Option Group object

The OptionGroup object represents an HTML- and opt-group-and-gt;

Access optionGroup objects

You can use getElementById() to access the elements of the .lt;optgroup:

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

Create an OptionGroup object

You can use the document.createElement() method to create the element of the .lt;optgroup:

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

OptionGroup object properties

Attributes describe
disabled Set or return to whether or not the option group is disabled.
label Set or return the value of the Label property of the option group.

Standard properties and events

OptionGroup objects also support standard properties and events.


Related articles

HTML Reference Manual: HTML slt;optgroup.gt; Tags