X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

HTML DOM Label Object


Label Object

The Label object represents an HTML <label> element.

Access a Label Object

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

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

Create a Label Object

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

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

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



Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook