The <data>
tag is an HTML5 tag that is used to represent a value that is not intended to be displayed on the web page but is intended to be used for machine-readable data. It is typically used to store data that is associated with a particular element on the page, such as a numerical value that represents the number of items in a shopping cart or a date and time stamp for a blog post.
The <data>
tag can contain any type of content, including text, numbers, and dates, and it can also have attributes like value
to specify the value of the data. The <data>
tag is a semantic tag, which means it provides meaning and context to the content it contains.
Here is an example of how to use the <data>
tag:
<p>The total number of items in your shopping cart is <data value=”5″>5</data>.</p>
In this example, the value “5” is associated with the text “The total number of items in your shopping cart is” and is not intended to be displayed on the page. However, it can be used by other software or scripts to retrieve or manipulate the value of the data.
[…] <data> […]