HTML / HTML Tags

HTML <Data> Tag

Dec 12, 2022
1 min read
HTML data Tag

Definition

The <data> Tag links its content with a machine-readable form of that content via the value attribute.

Example

The following example links the ISBN to the name of the book.

<p>Lord of the Rings books:</p>
<ul>
    <li><data value="9780553714784">The Fellowship of the Ring</data></li>
    <li><data value="9780739301197">The Two Towers</data></li>
    <li><data value="9780788789557">The Return of the King</data></li>
</ul>

Usage

  • The <data> element must be used with the value attribute.
  • The value attribute must be a representation of the element’s contents.

Attributes

The Data element supports the Global Attributes, along with the following:

  • value

    The value attribute specifies the machine-readable translation of the content.

Best Practices

  • Where the value attribute represents a date or time, then the more specific <time> element should be used.

Specification

Browser Support

Desktop

ChromeEdgeFirefoxIEOperaSafari
YesYesYesNoYesYes

Mobile

Android WebviewChrome AndroidFirefox AndroidOpera AndroidiOS SafariSamsung Internet
YesYesYesYesYesYes