HTML Tag


The <data> tag in HTML is used to set the current content with machine readable by translating it.

Syntax

Following is the syntax −

<data value=””>

Above, value sets the machine-readable form of the content.

Example

Let us now see an example to implement the <data> tag −

 Live Demo

<!DOCTYPE html>
<html>
<body>
<h2>Subjects covered in Schools</h2>
<p>Associating the subject name with number:</p>
<ul>
<li><data value="1000">Maths</data></li>
<li><data value="1003">Science</data></li>
<li><data value="1009">English</data></li>
<li><data value="1030">Political Science</data></li>
<li><data value="1045">French</data></li>
</ul>
</body>
</html>

Output

This will produce the following output −

In the above example, we have set number to the content by translation −

<ul>
<li><data value="1000">Maths</data></li>
<li><data value="1003">Science</data></li>
<li><data value="1009">English</data></li>
<li><data value="1030">Political Science</data></li>
<li><data value="1045">French</data></li>
</ul>

We set the machine-readable form to content using the <data> element −

<data value="1000">
Maths
</data>

Updated on: 17-Sep-2019

53 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements