Latest web development tutorials

HTML DOM Legend objects

Legend objects

Legend object represents an HTML <legend> element.

Object Access Legend

You can use getElementById () to access the <legend> element:

var x = document.getElementById("myLegend"); 尝试一下

Create Legend objects

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

var x = document.createElement("LEGEND"); 尝试一下

Legend Object Properties

属性 描述
form 返回一个包含 legend 的表单的引用。

Standard properties and events

Legend object also supports the standard attributes and events .


related articles

HTML Reference Manual: HTML <fieldset> tag

HTML Reference Manual: HTML <Legend> tag