HTMLLinkElement: fetchPriority property
Baseline
2024
Newly available
Since October 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The fetchPriority property of the HTMLLinkElement interface represents a hint to the browser indicating how it should prioritize fetching a particular resource relative to other resources of the same type.
It reflects the <link> element's fetchpriority content attribute.
Value
A string. For the permitted values, see the HTML fetchpriority attribute.
Examples
js
const preloadLink = document.createElement("link");
preloadLink.href = "my-image.jpg";
preloadLink.rel = "preload";
preloadLink.as = "image";
preloadLink.fetchPriority = "high";
document.head.appendChild(preloadLink);
Specifications
| Specification |
|---|
| HTML> # dom-link-fetchpriority> |
Browser compatibility
See also
HTMLImageElement.fetchPriorityHTMLScriptElement.fetchPriority- HTTP
Linkheader - Optimize resource loading with the Fetch Priority API for information about how this API affects priorities on Chrome.