CKTIS / HTML
itemref — microdata properties outside the itemscope element
The itemref attribute extends a microdata item's property search to elements identified by their id values. It associates data outside the itemscope element's descendants without changing the document structure.
Version: WHATWG HTML Living Standard; index snapshot date recorded separately
Syntax
itemref="id1 id2" (on an HTML element with itemscope)itemref is allowed only on an HTML element with itemscope. It identifies additional places to search for properties marked with itemprop; it neither creates a property nor assigns the item an identifier.
Its value is an unordered set of unique id references separated by ASCII whitespace. Targets must belong to the same tree. Write details, not #details: this is an identifier, not a CSS selector or URL. The algorithm skips a missing target, but that markup does not meet authoring requirements.
Processing includes the referenced element and its descendants, but stops descending at another itemscope. Ordinary descendants of the original item remain included. Avoid overlapping paths that revisit an element and cyclic item relationships: these are microdata errors.
In the example, details supplies role to the item containing name. The item deliberately has no itemtype; its property names are for local use. The output represents a simplified property map, not text automatically printed by the browser.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>itemref example</title>
<div itemscope itemref="details">
<span itemprop="name">Ada</span>
</div>
<div id="details">
<span itemprop="role">Programmer</span>
</div>
</html>Result
{"name":"Ada","role":"Programmer"}The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.