HTML DOM LegendObject


Legend Object

The Legend object represents an HTML <legend> element.

Access a Legend Object

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

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

Create a 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

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

Standard Properties and Events

The Legend object also supports standardpropertiesandevents。


Related Articles

HTML Reference Manual:HTML <fieldset> Tag

HTML Reference Manual:HTML <legend> Tag

Other Extensions