This page was translated from English by the community.Learn more and join the MDN Web Docs community.
HTMLLinkElement
Baseline Widely available *
This feature is well established and works across many devices and browser versions. It’s been available across browsers since июль 2015 г..
* Some parts of this feature may have varying levels of support.
ИнтерфейсHTMLLinkElement представляет справочную информацию для внешних ресурсов и отношение этих ресурсов к документу и наоборот (соответствует элементу<link>; не путать с<a>, который представлен элементомHTMLAnchorElement). Этот объект наследует все свойства и методы интерфейсаHTMLElement.
In this article
Свойства
Наследует свойства от своего родителя,HTMLElement, иLinkStyle.
HTMLLinkElement.asЭто
DOMStringпредставляющий тип контента загружаемый по HTML ссылке.HTMLLinkElement.crossOriginЭкспериментальная возможностьIs a
DOMStringthat corresponds to the CORS setting for this link element. SeeCORS settings attributes for details.HTMLLinkElement.disabledIs a
Booleanwhich represents whether the link is disabled; currently only used with style sheet links.HTMLLinkElement.hrefIs a
DOMStringrepresenting the URI for the target resource.HTMLLinkElement.hreflangIs a
DOMStringrepresenting the language code for the linked resource.HTMLLinkElement.mediaIs a
DOMStringrepresenting a list of one or more media formats to which the resource applies.HTMLLinkElement.referrerPolicyЭкспериментальная возможностьIs a
DOMStringthat reflects thereferrerpolicyHTML attribute indicating which referrer to use.HTMLLinkElement.relIs a
DOMStringrepresenting the forward relationship of the linked resource from the document to the resource.HTMLLinkElement.relListТолько для чтенияIs a
DOMTokenListthat reflects therelHTML attribute, as a list of tokens.HTMLLinkElement.sizesТолько для чтенияIs a
DOMSettableTokenListthat reflects thesizesHTML attribute, as a list of tokens.LinkStyle.sheetТолько для чтенияReturns the
StyleSheetobject associated with the given element, ornullif there is none.HTMLLinkElement.typeIs a
DOMStringrepresenting the MIME type of the linked resource.
Устаревшие свойства
HTMLLinkElement.charsetIs a
DOMStringrepresenting the character encoding for the target resource.HTMLLinkElement.revIs a
DOMStringrepresenting the reverse relationship of the linked resource from the resource to the document.Примечание:Currently the W3C HTML 5.2 spec states that
revis 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.targetIs a
DOMStringrepresenting the name of the target frame to which the resource applies.
Методы
Не имеет методов; наследует методы от своего родителя,HTMLElement, иLinkStyle.
Спецификации
| Specification |
|---|
| HTML> # htmllinkelement> |
Совместимость с браузерами
Смотрите также
- Элемент HTML, реализующий этот интерфейс:
<link>.