HTML5
HTML itemid Attribute
The itemid attribute is part of HTML5 microdata — a way to embed machine-readable structured data in your HTML. itemid assigns a global, unique identifier (usually a URL/URI) to an item, helping search engines and other tools reference the same entity.
What Is the itemid Attribute?
microdata lets you annotate content with a machine-readable vocabulary. An 'item' is defined with itemscope, its type with itemtype, and its properties with itemprop. The itemid attribute gives that item a globally unique identifier so tools can recognize it as the same entity across documents.
Rules for Using itemid
- itemid can only be used on an element that also has itemscope and itemtype.
- The itemtype's vocabulary must support global identifiers for itemid to be meaningful.
- The value is typically a URL or URN that uniquely identifies the item.
Example
<div itemscope
itemtype="http://vocab.example.net/book"
itemid="urn:isbn:0-330-34032-8">
<span itemprop="title">The Hitchhiker's Guide to the Galaxy</span>
by <span itemprop="author">Douglas Adams</span>
</div>itemid works together with itemscope and itemtype. On its own it has no effect — it identifies the item defined by the surrounding microdata scope.
