1. Technology



DATA Description:

The DATA element is used to define selections of content that are data that have a machine-readable format or translation. For example, a date can be written in many ways:

December 16, 2011
Dec 16, 2011

And while computers can be trained to read any of those formats correctly, there is an ISO standard for dates which reads YYYY-MM-DD or 2011-12-16. By enclosing any of those dates with a DATA element you can define the ISO value so that a computer can read the date reliably.

The DATA element is new in HTML5.

DTD: HTML5: <!doctype html>

DATA Web Browser Support:


DATA Attributes:

Global attributes, event attributes and:
  • value (required)

DATA End Tag:


DATA Contents:

The DATA element is a semantic element that represents computer data and contains a machine-readable form of the contents in the value attribute.

Tags valid as content: Phrasing elements and character data

DATA Usage:

Tags valid as container: Phrasing elements

DATA Special Notes:

The DATA element can be used along with microformats or microdata to make the contents both machine-readable for data processors and human-readable. In this case the value attribute would be determined by the microformats or microdata vocabulary in use.

The DATA element can also be used along with scripts on the page for scripts that have a literal value to store along with a human-readable value. In this case the format of the value attribute and the contents of the DATA element depend upon what the script needs.

The DATA Element and the data-* Attribute
Another way you can embed machine-readable data into your HTML5 documents is with the data-* attribute. This is different from the DATA element because it is an attribute that goes on an existing element. It also does not semantically define the enclosed content as data.

More DATA Information:

©2014 About.com. All rights reserved.