HTML Data Tag

The HTML tag is used to provide a machine readable version of its own contents. It displays the data in a special format. It is useful in the case where your data needs to be in a certain format because it may be processed by a script, but this might not be the format that you'd like your users to see.

Let's take a scenario to understand it well:

Suppose you have to represent some numbers to your users with letter (i.e. one, two, three and so on) but you have script that sorts the numbers in ascending or descending orders. So your script needs numbers in a format like 1, 2, 3... etc.

The tag is here to solve your problem.

For the users: Write within the .... tag.

For the script: Use value attribute.

HTML data tag attribute

There is only one required attribute. The data tag supports global and event attributes also.

Attribute Description
value It is required attribute. It is used to provide the machine-readable version of tag's content.

HTML data tag example

Test it Now


  • Java Tutorial
  • SQL tutorial
  • HTML tutorial

Supporting Browsers

Element chrome browser Chrome ie browser IE firefox browser Firefox opera browser Opera safari browser Safari
Yes Yes Yes Yes Yes
Next TopicHTML datalist tag

Hot Tutorials

Contact US

HTML data Tag