The HTML <data> element links a given content with a machine-readable translation. If the content is time- or date-related, the {{HTMLElement("time")}} element must be used.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
| Content categories | Flow content, phrasing content, palpable content. |
|---|---|
| Permitted content | Phrasing content. |
| Tag omission | {{no_tag_omission}} |
| Permitted parents | Any element that accepts phrasing content. |
| DOM interface | {{domxref("HTMLDataElement")}} |
This element's attributes include the global attributes.
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>
| Specification | Status | Comment |
|---|---|---|
| {{SpecName('HTML WHATWG', 'semantics.html#the-data-element', '<data>')}} | {{Spec2('HTML WHATWG')}} | No change from {{SpecName('HTML5 W3C')}} |
| {{SpecName('HTML5 W3C', 'text-level-semantics.html#the-data-element', '<data>')}} | {{Spec2('HTML5 W3C')}} | Initial definition. |
{{Compat("html.elements.data")}}