The value attribute on a <data> tag sets the value of the data element.
This value adds additional information to the content of the data element.
The value is not visible, but it is readable by JavaScript, screenreaders, etc.
A value attribute on 3 <data> elements.
The invisible values represent the cost of each product.
<ol>
<li><data value="$2.19">Sugar</data></li>
<li><data value="$2.99">Jelly</data></li>
<li><data value="$3.97">Bread</data></li>
</ol>
The value attribute adds extra information to the content of the <data> element.
This attribute may contain anything: id, price, availability, model, color, etc.
The value is not visible, but can be used by JavaScript, screenreaders, and others.
Note: Not all browsers support the <data> element.
Consider using a data-* attribute instead.
<data value="value">
Value | Description |
---|---|
value | An alphanumeric string. |
Here is when value support started for each browser:
Chrome
|
62.0 | Oct 2017 |
Firefox
|
22.0 | Jun 2013 |
IE/Edge
|
13.0 | Nov 2015 |
Opera
|
49.0 | Nov 2017 |
Safari
|
Not Supported |
Back to <data>