Back to Content

HTMLImageElement: fetchPriority property

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

latest1.1 KB
Original Source

{{APIRef("HTML DOM")}}

The fetchPriority property of the {{domxref("HTMLImageElement")}} interface represents a hint to the browser indicating how it should prioritize fetching a particular image relative to other images. It reflects the `` element's fetchpriority content attribute.

Value

A string whose value is one of high, low, or auto. For their meanings, see the HTML fetchpriority attribute.

Examples

js
const img = new Image();
img.fetchPriority = "high";
img.src = "img/logo.png";

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also