Breaking

Wednesday, May 1, 2019

HTML data Tag

HTML <data> Tag


Example

The following example displays product names but also associates each name with a product number:
<ul>
  <li><data value="21053">Cherry Tomato</data></li>
  <li><data value="21054">Beef Tomato</data></li>
  <li><data value="21055">Snack Tomato</data></li>
</ul>
Try it Yourself »

Definition and Usage

The <data> tag links the given content with a machine-readable translation.
This element provides both a machine-readable value for data processors, and a human-readable value for rendering in a browser.
Tip: If the content is time- or date-related, the<time> element must be used instead.

Browser Support

Element
<data>62.0Yes22.0Not supported49.0

Differences Between HTML 4.01 and HTML5

The <data> tag is new in HTML5.

Attributes

AttributeValueDescription
valuemachine-readable formatSpecifies the machine-readable translation of the content of the element

Global Attributes

The <data> tag also supports the Global Attributes in HTML.

No comments:

Post a Comment