<data>
data tag
The <data>
element connects human-readable content with a machine-readable value. For date or time information, consider using the <time>
element instead.
Syntax
<data value="machine-readable-value">Human-readable content</data>
data
Demo
- The example below links product names to their respective product numbers.
New Products
- Mini Ketchup
- Jumbo Ketchup
- Mega Jumbo Ketchup
<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>
Definition and Usage
- The
<data>
tag provides a way to include machine-readable values alongside human-readable content. - It allows web applications and data processors to extract structured information while maintaining readability for users.
<data>
tag embeds structured, machine-readable information within HTML content, making it valuable for web applications and data handling.Attributes
This element supports global attributes.
value
: Defines the machine-readable version of the content.
Conclusion
The <data>
element in HTML is useful for associating machine-readable values with human-readable content. It enhances web applications by improving data accessibility and processing efficiency. This element is particularly beneficial for displaying structured data such as product numbers or unique identifiers while ensuring readability. For date and time-specific content, the <time>
element is recommended.
<code>
The HTML <code> element denotes a section of computer code, usually rendered in a monospace font to set it apart from standard text.
<del>
The <del> element in HTML is used to indicate deleted or removed text in a document. Browsers typically render it with a strikethrough to show that the content was removed.