Latest web development tutorials

HTML DOM Legend form properties

Label Object Reference Label objects

Examples

Returns Form <legend> element's id:

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

x The output is:

myForm

try it"

Definition and Usage

form property returns a reference to the form of the legend.

If successful, the property returns a form object.

Note: This property is read-only.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support form property.


grammar

legendObject .form

technical details

return value: It contains a reference to the legend of the form. If the legend is not within a form, then return null.


Label Object Reference Label objects