Back to Content

HTMLLinkElement: fetchPriority property

files/en-us/web/api/htmllinkelement/fetchpriority/index.md

latest1.2 KB
Original Source

{{APIRef("HTML DOM")}}

The fetchPriority property of the {{domxref("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

{{Specifications}}

Browser compatibility

{{Compat}}

See also