HTMLImageElement: fetchPriority property

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{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 <img> element's [fetchpriority](/en-US/docs/Web/HTML/Reference/Elements/img#fetchpriority) content attribute.

Value

A string whose value is one of high, low, or auto. For their meanings, see the HTML [fetchpriority](/en-US/docs/Web/HTML/Reference/Attributes/fetchpriority) attribute.

Examples

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

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("HTMLLinkElement.fetchPriority")}}
  • {{domxref("HTMLScriptElement.fetchPriority")}}
  • HTTP {{httpheader("Link")}} header
  • Optimize resource loading with the Fetch Priority API for information about how this API affects priorities on Chrome.