I volontari di MDN non hanno ancora tradotto questo articolo in Italiano. Unisciti a noi e traducilo tu stesso.
Puoi anche consultare l’articolo in English (US).
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.
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 | 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
Desktop | Mobile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Basic support | Chrome Full support 62 | Edge Full support Yes | Firefox Full support 22 | IE No support No | Opera Full support 49 | Safari No support No | WebView Android Full support 62 | Chrome Android Full support 62 | Edge Mobile Full support Yes | Firefox Android Full support 22 | Opera Android Full support 49 | Safari iOS No support No | Samsung Internet Android No support No |
Legend
- Full support
- Full support
- No support
- No support
See also
- The HTML
<time>
element.