CodesJava

Easy learning with example program codes

Data HTML

HTML Data Tag

To provide a machine-readable version of the specified content, the HTML <data> tag is used. The data is displayed in a special format. It is useful both for getting a machine-readable value for data processors, and for displaying a human-readable value on a browser.

Syntax:

<data value=”1″>content</data>

Example:

<!DOCTYPE html>
<html>
<body>
<p>List of Students Names:</p>
<ul>
  <li><data value="110">Happy Singh</data></li>
  <li><data value="210">Joy Gupta</data></li>
  <li><data value="310">Smiley Das</data></li>
</ul>
</body>
</html>

Output:

Explanation:

In the above example, a list of students’ names are displayed, where each name is associated with the student’s Id.

Tag specific Attributes:

AttributeUses
valueUsed to define the machine-readable version of the specified content.

Global Attributes:

The Global attributes are supported by the HTML <data> tag.

Supporting Browsers:

Chrome, IE, Firefox and Opera.

Please follow and like us:
error
Posted in HTML   









Copyright © 2019 CodesJava DMCA.com Protection Status