Introduction
The ‘<data>
‘ tag is used to add a machine-readable translation of a given content.
This element provides both a machine-readable value for data processors, and a human-readable value for rendering in a browser.
Here is an example :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
data:hover::after {
content: ' (ID ' attr(value) ')';
font-size: 0.7em;
}
</style>
</head>
<body>
<p>New Products:</p>
<ul>
<li><data value="398">Mini Ketchup</data></li>
<li><data value="399">Jumbo Ketchup</data></li>
<li><data value="400">Mega Jumbo Ketchup</data></li>
</ul>
</body>
</html>
Output :
When we move curser to the products it will give the id of the element. Like this