Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <data> value Attribute

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.

Example

#

A value attribute on 3 <data> elements.
The invisible values represent the cost of each product.

  1. Sugar
  2. Jelly
  3. Bread
<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>

Using value

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.


Syntax

<data value="value">

Values

#

Value Description
value An alphanumeric string.

Browser support

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

You may also like

 Back to <data>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides