<data>

The HTML <data> element links a machine-readable value to human-readable content, enhancing data processing and accessibility by offering a standardized way to represent 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

index.html
<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
index.html
<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.
The <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.