HTML itemref Attribute
The HTML itemref attribute associates properties located outside an item's normal element hierarchy with a Microdata item by referencing the id values of other elements in the document.
Global Attribute
The itemref attribute is a global attribute and is part of HTML Microdata. It can only be specified on an element that also has the itemscope attribute.
How itemref Works
Normally, properties of a Microdata item are contained within the element that has the itemscope attribute. The itemref attribute allows additional properties elsewhere in the document to be associated with that item.
<article itemscope itemtype="https://schema.org/Book" itemref="book-author">
<h3 itemprop="name">HTML Guide</h3>
</article>
<p id="book-author">
Author: <span itemprop="author">Jane Smith</span>
</p>
The paragraph is outside the <article>, but its id is listed by itemref. The author property is therefore associated with the same Microdata item.
itemref Values
The value of itemref is an unordered set of unique space-separated tokens. Each token must match the id of an element in the same document.
itemref="book-author book-date"
The referenced values are element IDs, not values from the itemid attribute.
Multiple References
More than one element can be associated with an item by listing multiple element IDs in the itemref attribute.
<article itemscope
itemtype="https://schema.org/Book"
itemref="book-author book-date">
<h3 itemprop="name">HTML Guide</h3>
</article>
<p id="book-author">
Author: <span itemprop="author">Jane Smith</span>
</p>
<p id="book-date">
Published: <time itemprop="datePublished" datetime="2026-09-21">September 21, 2026</time>
</p>
Both referenced elements contribute properties to the Microdata item even though they are outside the element containing itemscope.
itemref vs. itemid
The itemref and itemid attributes have different purposes in Microdata.
| Attribute | Description |
|---|---|
itemref |
References element IDs elsewhere in the same document so their properties can be associated with an item. |
itemid |
Provides a global identifier for a Microdata item when permitted by the vocabulary being used. |
An itemref value therefore references the HTML id attribute of another element, not that element's itemid.
Related Microdata Attributes
The itemref attribute works with HTML's other Microdata attributes to describe items and their properties.
| Attribute | Description |
|---|---|
itemscope |
Creates a new Microdata item and defines the scope of its properties. |
itemtype |
Identifies the vocabulary and type associated with the item. |
itemid |
Provides a global identifier for an item when permitted by its vocabulary. |
itemprop |
Adds one or more properties to an item. |
itemref |
Associates properties elsewhere in the document with an item. |
Common Mistakes
Do not use itemref on an element that does not also have the itemscope attribute.
Do not place # before an ID in the itemref value. Use the ID itself, such as itemref="book-author", rather than itemref="#book-author".
Do not use itemid values as itemref references. The tokens in itemref refer to HTML element IDs in the same document.
Make sure each referenced ID identifies an element containing properties that should actually belong to the Microdata item.
Browser Support
Baseline: Widely available indicates a feature has been supported by core browsers for at least 30 months. At this stage, the feature is considered stable and safe for most websites to use without needing to worry about compatibility issues or fallbacks, as it is supported by the vast majority of users' devices and browser versions.
The itemref attribute used with HTML microdata is supported in current core browsers. Browser support for microdata attributes is generally separate from whether search engines or other consumers use the structured data.
Checking Browser Support
For current browser compatibility information, visit Can I Use? . Search for the HTML element or attribute you want to check. You can also narrow your search by entering an element name and attribute name separated by a colon. Search results can include related HTML features, element attributes, input types, APIs, and other technologies, so select the result that most closely matches the feature you are checking.
Try the itemref Attribute
The example describes a book with Microdata while placing the author and publication date outside the main item. The itemref attribute associates those additional properties with the book.
Summary
The HTML itemref attribute allows properties outside an item's normal element hierarchy to be associated with a Microdata item. It is used on an element with itemscope and contains one or more unique space-separated element IDs. The referenced elements can then contribute additional itemprop properties to the item.
