HTML 5: The Markup Language (ARIA Edition)

9. Datatypes # T

This section defines datatypes that are referenced by attribute definitions in the HTML elements, Common attributes, and Forms attributes sections.

9.01. String #

For any attribute definition in this document that references the string datatype, a string is defined as normal character data.

The Attributes section of this document describes additional restrictions on strings in attribute values — in particular, restrictions for the following cases:

9.02. Token #

For any attribute definition in this document that references the token datatype, a token is defined as a string that does not contain any space characters.

9.03. Tokens #

tokens = #
A space-separated list of zero or more token instances.

9.04. Browsing-context-name #

browsing-context-name = #
Any string, with the following restrictions:
  • must not start with a "_" character
  • must be at least one character long

9.05. Browsing-context-name-or-keyword #

browsing-context-name-or-keyword = #
Any string that is either of the following:

9.06. ID #

id = #
Any string, with the following restrictions:

9.07. IDREF #

idref = #
Any string, with the following restrictions:

9.08. IDREFS #

idrefs = #
A space-separated list of one or more idref instances.

9.09. Name #

name = #
Any string, with the following restrictions:

9.10. Hash-name #

hash-name = #
A valid hash-name reference to an element of type type is a string that starts with a "#" character, followed by a string which exactly matches the value of the name attribute of an element in the document with type type.

9.11. Integer #

integer = #
One or more characters in the range 0—9, optionally prefixed with a "-" character.

9.12. Positive integer #

integer.positive = #
Any non-negative integer, with the following restriction:
  • must be greater than zero

9.13. Non-negative integer #

integer.non-negative = #
One or more characters in the range 0—9.

9.14. Float #

float = #
A float consists of the following parts, in exactly the following order:
  1. Optionally, the first character may be a "-" character.
  2. One or more characters in the range "0—9".
  3. Optionally, the following parts, in exactly the following order:
    1. a "." character
    2. one or more characters in the range "0—9"
  4. Optionally, the following parts, in exactly the following order:
    1. a "e" character or "E" character
    2. optionally, a "-" character or "+" character
    3. One or more characters in the range "0—9".

9.15. Positive float #

float.positive = #
A non-negative float, with the following restriction:
  • must be greater than zero

9.16. Non-negative float #

float.non-negative = #
A float, with the following restriction:
  • the first character may not be a "-" character

9.17. Datetime #

datetime = #
A valid date-time, as defined in RFC 3339 [RFC3339], with these additional qualifications:
  • the literal letters T and Z in the date/time syntax must always be uppercase
  • a date-fullyear is defined as four or more digits representing a number greater than 0

Examples:

1990-12-31T23:59:60Z
1996-12-19T16:39:57-08:00

9.18. Date-or-time #

date-or-time = #
Any one of the following:

9.19. URI #

uri = #
An IRI-reference, as defined in RFC 3987 [RFC3987].

Example:

http://example.org/hello

9.20. URIs #

uris = #
A space-separated list of zero or more IRI-reference instances.

9.21. Absolute URI #

uri.absolute = #
An IRI, as defined in RFC 3987 [RFC3987].

Examples:

/hello
#canvas
http://example.org/

9.22. Sizes #

sizes = #
An unordered set of unique space-separated tokens, each of which must be one of the following:
  • the literal string "any"
  • two valid non-negative integers that do not have a leading "0" character and that are separated by a single "x" character.

9.23. Mimetype #

mimetype = #
A string that identifies a valid MIME media type, as defined in RFC 2046 [RFC2046].

9.24. Charset #

charset = #

For documents in the HTML syntax: Any character set name listed in the IANA Character Sets list [IANACHARSET].

For documents in the XML syntax, any case-insensitive match for the string "UTF-8".

9.25. Meta-charset #

meta-charset = #
The following parts, in exactly the following order:
  1. The literal string "text/html;".
  2. Optionally, one or more space characters.
  3. The literal string "charset=".
  4. A charset.

9.26. Refresh #

refresh = #
Any one of the following:

9.27. Default-style #

default-style = #

9.28. Mediaquery #

mediaquery = #
A valid media query, as defined in Media Queries [MQ].

9.29. Langcode #

langcode = #
A valid language tag, as defined in RFC 4646 [RFC4646].

9.30. Keylabellist #

keylabellist = #
An ordered set of unique space-separated tokens, each of which must be exactly one Unicode code point in length.

9.31. Zero #

zero = #
The literal string "0".

9.32. Sandbox-allow-list #

sandbox-allow-list = #
An unordered set of unique space-separated tokens, each of which is one of the following literal strings:
  • "allow-same-origin"
  • "allow-forms"
  • "allow-scripts"

9.33. Javascript #

javascript = #
Any case-insensitive match for the literal string "javascript".

9.34. Mimetypelist #

mimetypelist = #
A set of comma-separated tokens, each of which is a valid mimetype, with no parameters.

9.35. Charsetlist #

charsetlist = #
A set of comma-separated tokens, each of which is a valid charset that specifies an ASCII-compatible character encoding.

9.36. Pattern #

pattern = #
A regular expression that must match the JavaScript Pattern production [ECMA262].

9.37. Datetime-local #

datetime-local = #
The following parts, in exactly the following order:
  1. A date.
  2. The literal string "T".
  3. A time.

Example:

1985-04-12T23:20:50.52
1996-12-19T16:39:57

9.38. Date #

date = #
A valid full-date, as defined in RFC 3339 [RFC3339], with the additional qualification that the year component is a date-fullyear as defined in this document.

Example:

1996-12-19

9.39. Month #

month = #
The following parts, in exactly the following order:
  1. A date-fullyear.
  2. The literal string "-".
  3. A date-month, as defined in RFC 3339 [RFC3339].

Example:

1996-12

9.40. Week #

week = #
The following parts, in exactly the following order:
  1. A date-fullyear.
  2. The literal string "-W".
  3. A date-week, as defined in RFC 3339 [RFC3339].

Example:

1996-W16

9.41. Time #

time = #
A valid partial-time, as defined in RFC 3339 [RFC3339].

Examples:

23:20:50.52
17:39:57

9.42. Emailaddress #

emailaddress = #
The following parts, in exactly the following order:
  1. A dot-atom, as defined in RFC 5322 [RFC5322], with the additional constraint that the CFWS production is excluded everywhere.
  2. A "@" character.
  3. A dot-atom, with the additional constraint that the CFWS production is excluded everywhere.

Examples:

foo-bar.baz@example.com

9.43. Emailaddresslist #

emailaddresslist = #
A set of comma-separated tokens, each of which is a valid emailaddress.

9.44. Color #

color = #
A string exactly seven characters long, consisting of the following parts, in exactly the following order:
  1. A "#" character.
  2. Six characters in the range 0–9, a–f, and A–F.