HTMLLinkElement

Интерфейс HTMLLinkElement представляет справочную информацию для внешних ресурсов и отношение этих ресурсов к документу и наоборот (соответствует элементу <link>; не путать с <a>, который представлен элементом HTMLAnchorElement). Этот объект наследует все свойства и методы интерфейса HTMLElement.

Свойства

Наследует свойства от своего родителя, HTMLElement, и LinkStyle (en-US).

HTMLLinkElement.as (en-US)

Это DOMString представляющий тип контента загружаемый по HTML ссылке.

HTMLLinkElement.crossOrigin (en-US) Экспериментальная возможность

Is a DOMString that corresponds to the CORS setting for this link element. See CORS settings attributes (en-US) for details.

HTMLLinkElement.disabled

Is a Boolean which represents whether the link is disabled; currently only used with style sheet links.

HTMLLinkElement.href

Is a DOMString representing the URI for the target resource.

HTMLLinkElement.hreflang (en-US)

Is a DOMString representing the language code for the linked resource.

HTMLLinkElement.media

Is a DOMString representing a list of one or more media formats to which the resource applies.

HTMLLinkElement.referrerPolicy (en-US) Экспериментальная возможность

Is a DOMString that reflects the referrerpolicy HTML attribute indicating which referrer to use.

HTMLLinkElement.rel (en-US)

Is a DOMString representing the forward relationship of the linked resource from the document to the resource.

HTMLLinkElement.relList (en-US) Только для чтения

Is a DOMTokenList that reflects the rel HTML attribute, as a list of tokens.

HTMLLinkElement.sizes Только для чтения

Is a DOMSettableTokenList that reflects the sizes HTML attribute, as a list of tokens.

LinkStyle.sheet (en-US) Только для чтения

Returns the StyleSheet object associated with the given element, or null if there is none.

HTMLLinkElement.type

Is a DOMString representing the MIME type of the linked resource.

Устаревшие свойства

HTMLLinkElement.charset

Is a DOMString representing the character encoding for the target resource.

HTMLLinkElement.rev

Is a DOMString representing the reverse relationship of the linked resource from the resource to the document.

Примечание: Currently the W3C HTML 5.2 spec states that rev is no longer obsolete, whereas the WHATWG living standard still has it labeled obsolete. Until this discrepancy is resolved, you should still assume it is obsolete.

HTMLLinkElement.target

Is a DOMString representing the name of the target frame to which the resource applies.

Методы

Не имеет методов; наследует методы от своего родителя, HTMLElement, и LinkStyle (en-US).

Спецификации

Specification
HTML Standard
# htmllinkelement

Совместимость с браузерами

BCD tables only load in the browser

Смотрите также

  • Элемент HTML, реализующий этот интерфейс: <link>.