Movatterモバイル変換


[0]ホーム

URL:


MDN Web Docs

<data>: The Data element

BaselineWidely available

The<data>HTML element links a given piece of content with a machine-readable translation. If the content is time- or date-related, the<time> element must be used.

Try it

<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>
data:hover::after {  content: " (ID " attr(value) ")";  font-size: 0.7em;}

Attributes

This element's attributes include theglobal attributes.

value

This attribute specifies the machine-readable translation of the content of the element.

Examples

The following example displays product names but also associates each name with a product number.

html
<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>

Result

Technical summary

Content categoriesFlow content,phrasing content, palpable content.
Permitted contentPhrasing content.
Tag omissionNone, both the starting and ending tag are mandatory.
Permitted parents Any element that acceptsphrasing content.
Implicit ARIA rolegeneric
Permitted ARIA rolesAny
DOM interfaceHTMLDataElement

Specifications

Specification
HTML
# the-data-element

Browser compatibility

See also

Help improve MDN

Learn how to contribute.

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp