Web Platform Atlas
EN⚡RUUA⚡DE⚡FR⚡ES⚡PL⚡PT⚡ZH⚡JA⚡
Каталог / HTML / The legend element

4.10.16 The legend element

Статический предпросмотр (RU): для MDN, WPT, глоссария и BYOK-перевода откройте интерактивный Атлас.
⚡ Открыть главу в Атласе

4.10.16 The legend element

Категории:

None.

Контексты, в которых может использоваться этот элемент:

As the first child of a fieldset element.

As the first child of an optgroup element.

Контентная модель:

If the element is a child of an optgroup element: Phrasing content, but there must be no interactive content and no descendant with the tabindex attribute.

Otherwise: Phrasing content, optionally intermixed with heading content.

Опущение тегов в text/html:

Ни один из тегов не может быть опущен.

Атрибуты контента:

глобальные атрибуты

Специфика доступности:

Для авторов.

Для разработчиков.

Санитизация:

Uncategorized.

DOM-интерфейс:

[Exposed=Window] interface HTMLLegendElement : HTMLElement { [HTMLConstructor] constructor(); readonly attribute HTMLFormElement? form; // also has obsolete members };

The legend element represents a caption for the rest of the contents of the legend element's parent fieldset element, if any. Otherwise, if the legend has a parent optgroup element, then the legend represents the optgroup's label.

legend.form

Returns the element's form element, if any, or null otherwise.

The form IDL attribute's behavior depends on whether the legend element is in a fieldset element or not. If the legend has a fieldset element as its parent, then the form IDL attribute must return the same value as the form IDL attribute on that fieldset element. Otherwise, it must return null.