<data>
Summary
The HTML <data>
Element links a given content with a machine-readable translation. If the content is time- or date-related, the <time>
must be used.
- Content categories (en-US) Flow content (en-US), phrasing content (en-US), palpable content.
- Permitted contentPhrasing content (en-US).
- Tag omission None, both the starting and ending tag are mandatory.
- Permitted parent elements Any element that accepts phrasing content (en-US).
- DOM interface
HTMLDataElement
(en-US)
Attributes
This element includes the global attributes (en-US).
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 its UPC code.
<p>New Products</p>
<ul>
<li><data value="3967381398">Mini Ketchup</data></li>
<li><data value="3967381399">Jumbo Ketchup</data></li>
<li><data value="3967381400">Mega Jumbo Ketchup</data></li>
</ul>
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of '<data>' in that specification. |
Padrão em tempo real | No change from Recomendação |
HTML5 The definition of '<data>' in that specification. |
Recomendação | Initial definition. |
Compatibilidade com navegadores
BCD tables only load in the browser
See also
- The HTML
<time>
element.