HTML DOM Legend Object

Legend Object

The Legend object represents the HTML <legend> element.

Access Legend Object

You can access the <legend> element by using getElementById():

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

Try It Yourself

Create Legend Object

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

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

Try It Yourself

Legend Object Properties

Properties Description
form Returns a reference to the form that contains the legend.

Standard Properties and Events

Legend Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Reference Manual:HTML <legend> Tag

HTML Reference Manual:HTML <fieldset> Tag