Definition
The <data>
Tag links its content with a machine-readable form of that content via the value
attribute.
Example
The following example links the ISBN to the name of the book.
<p>Lord of the Rings books:</p>
<ul>
<li><data value="9780553714784">The Fellowship of the Ring</data></li>
<li><data value="9780739301197">The Two Towers</data></li>
<li><data value="9780788789557">The Return of the King</data></li>
</ul>
Usage
- The
<data>
element must be used with thevalue
attribute. - The
value
attribute must be a representation of the element’s contents.
Attributes
The Data element supports the Global Attributes, along with the following:
value
The
value
attribute specifies the machine-readable translation of the content.
Best Practices
- Where the
value
attribute represents a date or time, then the more specific<time>
element should be used.
Specification
Browser Support
Desktop
Chrome | Edge | Firefox | IE | Opera | Safari |
---|---|---|---|---|---|
Yes | Yes | Yes | No | Yes | Yes |
Mobile
Android Webview | Chrome Android | Firefox Android | Opera Android | iOS Safari | Samsung Internet |
---|---|---|---|---|---|
Yes | Yes | Yes | Yes | Yes | Yes |