The HTML <data>
element links a given content with a machine-readable translation. If the content is time- or date-related, the <time>
element must be used.
Content categories | Flow content, phrasing content, palpable content. |
---|---|
Permitted content | Phrasing content. |
Tag omission | None, both the starting and ending tag are mandatory. |
Permitted parents | Any element that accepts phrasing content. |
DOM interface | HTMLDataElement |
Attributes
This element's attributes include the global attributes.
value
- This attribute specifies the machine-readable translation of the content of the element.
Example
The following example displays product names but also associates each name with a product number.
<p>New Products</p> <ul> <li><data value="398">Mini Ketchup</data></li> <li><data value="399">Jumbo Ketchup</data></li> <li><data value="400">Mega Jumbo Ketchup</data></li> </ul>
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of '<data>' in that specification. |
Living Standard | No change from HTML5 |
HTML5 The definition of '<data>' in that specification. |
Recommendation | Initial definition. |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic support | 62 | Yes | 22 | No | 49 | No |
Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic support | No | No | Yes | 22 | No | No | No |
See also
- The HTML
<time>
element.
Document Tags and Contributors
Tags:
Contributors to this page:
anton.ingfors,
teoli,
valtlai,
CNG,
sideshowbarker,
erikadoyle,
Sebastianz,
Jeremie,
kscarfone,
bronzehedwick,
tregagnon,
Sheppy,
Nickolay,
trevorh,
medicdude,
ethertank,
leegee,
rblancarte
Last updated by:
anton.ingfors,