This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2018.
The as property of the HTMLLinkElement interface returns a string representing the type of content to be preloaded by a link element.
The as property must have a value for link elements when rel="preload", or the resource will not be fetched. It may also be applied to link elements where rel="modulepreload", but if omitted, will default to script. The property should not be set for other types of link elements, such as rel="prefetch".
This property reflects the value of the as attribute of the <link> HTML element.
A string with the following allowed values: "audio", "document", "embed", "fetch", "font", "image", "object", "script", "style", "track", "video", "worker".
| Specification |
|---|
| HTML> # dom-link-as> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
as |
50 | 17 | 56 | 37 | 10 | 50 | 56 | 37 | 10 | 5.0 | 50 | 10 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement/as