HTML5 Guidelines for Web Developers

(coco) #1
Summary 271

Summary


In this chapter we take a closer look at the syntax of microdata, a mechanism to
add semantic markup to documents using a variety of global attributes. Starting
with the boolean attribute itemscope that marks the area relevant for microdata
and defines a new, empty group of name-value pairs— the so-called items—we
then move on to the itemprop attribute that actually defines the name of the cor-
responding property via its attribute value.


We use the itemtype attributes to denote standardized vocabularies like vCard for
contact information or vEvents for dates of events and itemid attributes to tag
items in these dialects with unique IDs, such as ISBN or EAN numbers. Last but
not least we finish the topic of microdata attributes with itemref, enabling us to
specify a comma-separated list of element IDs also to be searched for microdata
contents. A walk through the Microdata DOM API concludes this chapter and
shows how you can easily access your microdata structure via JavaScript.


Unfortunately, no browser supports microdata at the time of this writing, so
the only way to explore the many examples shown in this chapter is with Phil-
ip Jägenstedt’s Live Microdata viewer, which is available at http://foolip.org/
microdatajs/live. We can only wait and see if and when microdata will eventu-
ally become established.

Free download pdf