# Bad value “” for attribute “itemprop” on element “X”.

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

The `itemprop` attribute needs at least one property name, so an empty value such as `itemprop=""` is invalid on any element.

`itemprop` belongs to HTML microdata. It marks an element as a property of the item created by its nearest `itemscope` ancestor, and its value is a space-separated list of property names, such as `headline`, `image` or `author`, or absolute URLs. An empty string, or a value made only of spaces, contains no names, and the validator reports it together with the element that carries it.

Empty values usually come from a theme or template that always prints the attribute and fills it in only when a property is configured. The microdata processing model skips any element whose `itemprop` has no names, so the attribute adds nothing to the item. On an `<img>`, the property value would be the image URL from `src`, and that value is lost.

Either write the property name your vocabulary defines (for a Schema.org `Article`, the main picture is `image`) or remove the attribute. Removing it is the right fix when the element sits outside any `itemscope`, because a named `itemprop` there triggers a different error saying the element is not a property of any item.

## Invalid example

```html
<article itemscope itemtype="https://schema.org/Article">
  <h1 itemprop="headline">Spring hiking routes</h1>
  <img src="trail.jpg" alt="A trail along a cliff" itemprop="">
</article>
```

## Valid example

```html
<article itemscope itemtype="https://schema.org/Article">
  <h1 itemprop="headline">Spring hiking routes</h1>
  <img src="trail.jpg" alt="A trail along a cliff" itemprop="image">
</article>
```

Without microdata, drop the attribute:

```html
<article>
  <h1>Spring hiking routes</h1>
  <img src="trail.jpg" alt="A trail along a cliff">
</article>
```
