Label formProperty

Label 对象参考手册Label Object

Examples

Returns the id of the form that contains the <label> element:

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

xThe output result is:

myForm

Try it yourself »

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 property.


Syntax

labelObject.form

Technical Details

Return value: A reference to the form that contains the label. If the label is not inside a form, null is returned.


Label 对象参考手册Label Object

Other Extensions