MDN self-hosted library · e01.org

HTMLScriptElement: fetchPriority property

HTML DOM

Open notebook · 2 cells web-api-instance-property upstream source

HTML DOM

The fetchPriority property of the HTMLScriptElement interface represents a hint to the browser indicating how it should prioritize fetching an external script relative to other external scripts. It reflects the <script> element's fetchpriority content attribute.

Value

A string. For the permitted values, see the HTML fetchpriority attribute.

Examples

<script id="el" type="module" src="main.js" fetchpriority="high"></script>
const el = document.getElementById("el");
console.log(el.fetchPriority); // Output: "high"

Specifications

Browser compatibility

See also