Summary
The HTML <legend> Element (or HTML Legend Field Element) represents a caption for the content of its parent {{HTMLElement("fieldset")}}.
- Content categories None.
- Permitted content Phrasing content.
- Tag omission {{no_tag_omission}}
- Permitted parent elements A {{HTMLElement("fieldset")}} whose first child is this <legend> element
- DOM interface {{domxref("HTMLLegendElement")}}
Attributes
This element only includes the global attributes.
Examples
See {{HTMLElement("form")}} for examples on <legend>
.
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', 'forms.html#the-legend-element', '<legend>')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C', 'the-legend-element.html#the-legend-element', '<legend>')}} | {{Spec2('HTML5 W3C')}} | |
{{SpecName('HTML4.01', 'forms.html#h-17.10', '<legend>')}} | {{Spec2('HTML4.01')}} |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoMobile("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
See also
- Others form-related elements: {{HTMLElement("form")}}, {{HTMLElement("option")}}, {{HTMLElement("label")}}, {{HTMLElement("button")}}, {{HTMLElement("select")}}, {{HTMLElement("datalist")}}, {{HTMLElement("optgroup")}}, {{HTMLElement("fieldset")}}, {{HTMLElement("textarea")}}, {{HTMLElement("keygen")}}, {{HTMLElement("input")}}, {{HTMLElement("output")}}, {{HTMLElement("progress")}} and {{HTMLElement("meter")}}.
{{HTML:Element_Navigation}}