HTMLImageElement: 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 HTMLImageElement
interface represents a hint to the browser indicating how it should prioritize fetching a particular image relative to other images. It reflects the <img>
element's fetchpriority
content attribute.
Value
A string. For the permitted values, see the HTML fetchpriority
attribute.
Examples
js
const img = new Image();
img.fetchPriority = "high";
img.src = "img/logo.png";
Specifications
Specification |
---|
HTML> # dom-img-fetchpriority> |
Browser compatibility
Loading…
See also
HTMLLinkElement.fetchPriority
HTMLScriptElement.fetchPriority
- HTTP
Link
header - Optimize resource loading with the Fetch Priority API for information about how this API affects priorities on Chrome.