<data> Tag in HTML

The <data> tag in HTML is used to associate a specific machine-readable value with human-readable content. This can be useful for displaying data in a way that is both accessible to users and easy for programs or scripts to process. The value attribute of the <data> tag stores the machine-readable data, while the content between the tags provides a readable format for users.

Key Points on <data> Tag:

Syntax of <data> Tag:

Syntax Example

<data value="machine-readable-value">Human-readable content</data>

Example of <data> Tag in HTML:

This example shows how to use the <data> tag to embed a machine-readable price value within a human-readable format.

Code Example


        <p>Product Price: <data value="19.99">$19.99</data></p>
                

Output

Product Price: $19.99

The <data> tag is useful when you want to display information that can be processed by machines, such as prices, dates, or quantities, while maintaining readability for users. It also improves SEO by helping search engines understand the content more effectively.