Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.
label
Type: string
The label that will appear on the element. If this is left out, no text appears. For an editable menuitem element the value of this attribute is copied to the menulist.value property upon user selection of the menuitem.

See also

Examples in JavaScript

<label value="Whaw" id="the-big-label" command="the-big-button"/>
<button id="the-big-button" label="Click me"
	oncommand="alert(document.getElementById('the-big-label').value)"/>

<label id="myLabel" value="My label"/>
<button label="Click me" 
	oncommand="document.getElementById('myLabel').setAttribute('value','Value changed');" />

<checkbox label="my Checkbox" id="myCheckboX"/>
<button label="Another click" 
	oncommand="document.getElementById('myCheckboX').setAttribute('label','Still not checked');"/>
<button label="Show label of checkbox" 
	oncommand="alert( document.getElementById('myCheckboX').getAttribute('label') )"/>

 

Document Tags and Contributors

 Contributors to this page: Sheppy, WP-Makyen, jswisher, M1k., Marsf, Mgjbot, Mrolappe, Ptak82, Okome, Pmash, Dria
 Last updated by: Sheppy,