HTML DOM OptionGroup Object | HTML OptionGroup  Tutorial by WDH

HTML DOM OptionGroup Object


 

 May 06, 2021  JavaScript with HTML DOM Reference book


Table of contents

1. HTML DOM Option Group object

2. Option Group object

3. OptionGroup object properties

4. Standard properties and events

5. Related articles


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