HTML DOM OptionGroup Object






<!--
main_leaderboard, all: [728,90][970,90][320,50][468,60]
-->



HTML DOM OptionGroup Object



❮ Previous
Next ❯



OptionGroup Object


The OptionGroup object represents an HTML <optgroup> element.


Access an OptionGroup Object


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



Example



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

Try it Yourself »

Create an OptionGroup Object


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



Example



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

Try it Yourself »

OptionGroup Object Properties















Property Description
disabled Sets or returns whether an option-group is disabled, or not
label Sets or returns the value the label attribute of an option-group

Standard Properties and Events


The OptionGroup object also supports the standard properties and events.




Related Pages


HTML reference: HTML <optgroup> tag





❮ Previous
Next ❯

Popular posts from this blog

Python Lists

Aion

JavaScript Array Iteration Methods