OptionGroup label eigenschap

Definitie en gebruik

label Eigenschap instellen of retourneren van de waarde van het label-eigenschap van de optiegroep.

HTML <optgroup> label Attribute Specifies the label/description of the option group.

Zie ook:

HTML Reference Manual:HTML <optgroup> Tag

Voorbeeld

Voorbeeld 1

Wijzigen van de label/descriptie van de optiegroep:

document.getElementById("myOptgroup").label = "华系车";

Probeer het zelf

Voorbeeld 2

Retourneren van de label/descriptie van de optiegroep:

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

Probeer het zelf

Sintaxis

Retourneren van het label-eigenschap:

optiongroupObject.label

Instellen van het label-eigenschap:

optiongroupObject.label = text

Attribute Value

Value Description
text Specifies the label/description of the option group.

Technical Details

Return Value: String value representing the label of the option group.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support

Related Pages

HTML Reference Manual:HTML <optgroup> label Attribute