1. Computing

Discuss in my forum

<data></data>

By

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
12/16/2011
Dec 16, 2011
2011-12-16

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:

None

DATA Attributes:

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

DATA End Tag:

Required

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:

  1. About.com
  2. Computing
  3. Web Design / HTML
  4. HTML and XHTML
  5. HTML 5
  6. HTML 5 Tags
  7. The data Tag - data - HTML 5

©2014 About.com. All rights reserved.