HTMLLinkElement
The interface for <link>. Extends HTMLElement → Element.
Reflected properties
All setters are guarded and throw NoModificationAllowedError on a read-only document.
| Property | Attribute | Type | Notes |
|---|---|---|---|
href |
href |
string | Reflects verbatim — no base-URL resolution. |
rel |
rel |
string | Reflects the content attribute verbatim. |
type |
type |
string | Reflects the content attribute verbatim. |
media |
media |
string | Reflects the content attribute verbatim. |
as |
as |
string | Reflects the content attribute verbatim. |
crossOrigin |
crossorigin |
nullable enum | Keywords: anonymous · use-credentials. Missing attribute → null; any other present value → "anonymous"; assigning null removes the attribute. |
referrerPolicy |
referrerpolicy |
enum | Keywords: "" · no-referrer · no-referrer-when-downgrade · same-origin · origin · strict-origin · origin-when-cross-origin · strict-origin-when-cross-origin · unsafe-url. Missing → ""; invalid → "". |
See also
- Element —
getAttribute/setAttribute, content,classList, traversal, insertion - HTMLElement — the global reflected properties every HTML element inherits
- JavaScript DOM API — the interface hierarchy and
instanceof