HTML data tag

Html data element defines the content and machine readable value of the content in the value attribute.


<data value="1i"> one item </data>
<data value="2i"> second item </data>
<data value="3i"> third item </data>
<data value="4i"> fourth item </data>	

Try </>

Machine readable format is in the value of this element. Value contains the id's of items.

Specific uses

It is used with microformats or in microdata. It provides both the machine-readable value for the data processor and the machine-readable value to use in web browser.

Tip: When the content is time related, then time element is more appropriate.

Tag omission

Both starting and ending tags are necessary for the data element.

Global Attributes

All the global attributes are applicable on the data element.

Specific Attributes

value value attribute defines the machine-readable value of the content.
<data value="45215">Laptop Model</data>

Was this article helpful?




Get the newsletter