HTML DOM Label Object






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



HTML DOM Label Object



❮ Previous
Next ❯



Label Object


The Label object represents an HTML <label> element.


Access a Label Object


You can access a <label> element by using getElementById():



Example



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

Try it Yourself »

Create a Label Object


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



Example



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

Try it Yourself »

Label Object Properties



















Property Description
control Returns the labeled control
form Returns a reference to the form that contains the label
htmlFor Sets or returns the value of the for attribute of a label

Standard Properties and Events


The Label object also supports the standard properties and events.




Related Pages


HTML tutorial: HTML Forms


HTML reference: HTML <label> tag





❮ Previous
Next ❯

Popular posts from this blog

Python Lists

Aion

JavaScript Array Iteration Methods