Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

HTML itemref global attribute

Properties that are not descendants of an element with theitemscope attribute can be associated with an item using theglobal attributeitemref.

itemref provides a list of element IDs (notitemids) elsewhere in the document, with additional properties

Theitemref attribute can only be specified on elements that have anitemscope attribute specified.

Note:Theitemref attribute 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 (inJSON-LD format):

json
{  "@id": "amanda",  "name": "Amanda",  "band": {    "@id": "b",    "name": "Jazz Band",    "size": 12  }}

HTML

html
<div itemscope itemref="a b"></div><p>Name: <span itemprop="name">Amanda</span></p><div itemprop="band" itemscope itemref="c"></div><div>  <p>Band: <span itemprop="name">Jazz Band</span></p>  <p>Size: <span itemprop="size">12</span> players</p></div>

Result

Specifications

Specification
HTML
# attr-itemref

See also

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp