Path: blob/main/files/en-us/web/html/global_attributes/itemref/index.md
6546 views
------{{HTMLSidebar("Global_attributes")}}
Properties that are not descendants of an element with the itemscope attribute can be associated with an item using the global attribute itemref.
itemref provides a list of element IDs (not itemids) elsewhere in the document, with additional properties
The itemref attribute can only be specified on elements that have an itemscope attribute specified.
Note: The
itemrefattribute is not part of the microdata data model. It is merely a syntactic construct to aid authors in adding annotations to pages where the data to be annotated does not follow a convenient tree structure. For example, it allows authors to mark up data in a table so that each column defines a separate item while keeping the properties in the cells.
Examples
Representing structured data for a band
This example uses microdata attributes to represent the following structured data (in JSON-LD format):
HTML
Result
{{EmbedLiveSample('Representing structured data for a band')}}
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
Other microdata related global attributes: