HTML5 <data>
Tag
Topic: HTML5 Tags ReferencePrev|Next
Description
The <data>
element links a piece of content with a machine-readable translation.
If the content is time or date related, the more specific <time>
element should be used instead.
The following table summarizes the usages context and the version history of this tag.
Placement: | Inline |
---|---|
Content: | Inline, and text |
Start/End Tag: | Start tag: required, End tag: required |
Version: | New in HTML5 |
Syntax
The basic syntax of the <data>
tag is given with:
The example below shows the <data>
tag in action.
Example
Try this code »<p>New Products</p>
<ul>
<li><data value="204">Green Tea</data></li>
<li><data value="205">Tomato Ketchup</data></li>
<li><data value="206">Roasted Coffee Beans</data></li>
</ul>
Tag-Specific Attributes
The following table shows the attributes that are specific to the <data>
tag.
Attribute | Value | Description |
---|---|---|
Required — The following attribute must be specified on this tag for the markup to be valid. | ||
value |
machine-readable | Specifies the machine-readable translation of the content of the element. |
Global Attributes
Like all other HTML tags, the <data>
tag supports the global attributes in HTML5.
Event Attributes
The <data>
tag also supports the event attributes in HTML5.
Browser Compatibility
The <data>
tag is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: HTML Lists.
Related tags: <time>
.