# Bad value X for attribute “fetchpriority” on element “img”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-x-for-attribute-fetchpriority-on-element-img
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `fetchpriority` attribute of an `<img>` is set to something other than `high`, `low` or `auto`.

`fetchpriority` is a hint about how soon the browser should fetch the image compared with the other images on the page. `high` suits the main image at the top of the page, `low` suits images that start out of view, such as the later slides of a carousel, and `auto`, the default, leaves the choice to the browser. The value has to be one of those three keywords with nothing around it. A made-up level such as `highest`, a keyword that belongs to another attribute such as `eager` (that one goes in `loading`) and an empty value all trigger this error.

When the reported value includes quotes, as in `"high"`, the quotes are inside the value itself. That usually happens when the quotes around the value were HTML-encoded as `&quot;`, often by a plugin or template that escaped markup a second time. `&quot;` can't delimit an attribute, so the parser reads `fetchpriority=&quot;high&quot;` as an unquoted value and decodes both references into literal quotes. Wrapping the value in two sets of quotes, as in `fetchpriority='"high"'`, gives the same result. A value with only a trailing quote, such as `high"`, means the opening quote is missing, and the validator also reports `“"” in an unquoted attribute value`.

Browsers treat an invalid value as `auto`, so the image still loads, but at the default priority. A hero image meant to be `high` can then start downloading later than intended. If you don't need a particular priority, remove the attribute.

The `&quot;` cause rarely affects `fetchpriority` alone. If `decoding`, `width`, `height`, `srcset` or `sizes` on the same `<img>` also report a stray `"`, fix the code that writes the tag instead of editing each attribute.

## Invalid example

```html
<img src="hero.jpg" alt="A mountain lake at sunrise" width="1200" height="600" fetchpriority=&quot;high&quot;>
<img src="hero.jpg" alt="A mountain lake at sunrise" width="1200" height="600" fetchpriority="highest">
```

## Valid example

```html
<img src="hero.jpg" alt="A mountain lake at sunrise" width="1200" height="600" fetchpriority="high">
```
