Интерфейс HTMLLinkElement
представляет справочную информацию для внешних ресурсов и отношение этих ресурсов к документу и наоборот (соответствует элементу <link>
; не путать с <a>
, который представлен элементом HTMLAnchorElement
). Этот объект наследует все свойства и методы интерфейса HTMLElement
.
Свойства
Наследует свойства от своего родителя, HTMLElement
, и LinkStyle
.
HTMLLinkElement.as
- Это
DOMString
представляющий тип контента загружаемый по HTML ссылке. HTMLLinkElement.crossOrigin
- Is a
DOMString
that corresponds to the CORS setting for this link element. See CORS settings attributes 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
- 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
- Is a
DOMString
that reflects thereferrerpolicy
HTML attribute indicating which referrer to use. HTMLLinkElement.rel
- Is a
DOMString
representing the forward relationship of the linked resource from the document to the resource. HTMLLinkElement.relList
Только для чтения- Is a
DOMTokenList
that reflects therel
HTML attribute, as a list of tokens. HTMLLinkElement.sizes
Только для чтения- Is a
DOMSettableTokenList
that reflects thesizes
HTML attribute, as a list of tokens. LinkStyle.sheet
Только для чтения- Returns the
StyleSheet
object associated with the given element, ornull
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 thatrev
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
.
Спецификации
Specification | Status | Comment |
---|---|---|
Preload | Кандидат в рекомендации | Defines <link rel="preload"> , and the as property. Note that currently Firefox only supports preloading of cacheable resources. |
HTML Living Standard Определение 'HTMLLinkElement' в этой спецификации. |
Живой стандарт | Adds the following properties: crossOrigin , referrerPolicy , and as . |
HTML 5.1 Определение 'HTMLLinkElement' в этой спецификации. |
Рекомендация | |
HTML5 Определение 'HTMLLinkElement' в этой спецификации. |
Рекомендация | The following properties are now obsolete: charset , rev , and shape .The following properties have been added: relList , and sizes . |
Document Object Model (DOM) Level 2 HTML Specification Определение 'HTMLLinkElement' в этой спецификации. |
Устаревшая | Added a second inheritence, the LinkStyle interface. |
Document Object Model (DOM) Level 1 Specification Определение 'HTMLLinkElement' в этой спецификации. |
Устаревшая | Initial definition. |
Совместимость браузера
BCD tables only load in the browser
Смотрите также
- Элемент HTML, реализующий этот интерфейс:
<link>
.