Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Label form property

Label form property

Label Object Reference Label Object

Example

Return the form containing

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

x The output is:

myForm

Try it »


Definition and Usage

The form property returns a reference to the form that contains the label.

If successful, this property returns a form object.

**Note:** This property is read-only.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the form attribute.


Syntax

labelObject

.form

Technical Details

Return Value: A reference to the form that contains the label. If the label is not inside a form, it returns null.

Label Object Reference Label Object