This section describes data types (microsyntaxes) that are referenced by attribute descriptions in the HTML elements, and Global attributes sections.
The Attributes section of this document describes additional restrictions on strings in attribute values — in particular, restrictions for the following cases:
,
"
(comma) character. Each string itself
must
not begin or end with any
space characters,
and each string itself
must
not contain any
",
"
(comma) characters._blank
",
"_self
",
"_parent
",
or
"_top
".
Previous versions of HTML placed greater restrictions on the content of ID values (for example, they did not permit ID values to begin with a number).
id
attribute of an element of type
type
anywhere in the document.#
"
character, followed by a string which
exactly matches the value of the
name
attribute of an element of type
type
anywhere in the document.0—9
,
optionally prefixed with a
"-
"
character.0—9
.-
"
character.0—9
"..
"
character0—9
"e
"
character or
"E
"
character-
"
character or
"+
"
character0—9
".-
"
characterT
and
Z
in the date/time syntax
must
always be
uppercaseExamples:
1990-12-31T23:59:60Z
1996-12-19T16:39:57-08:00
Example:
1996-12-19
-
".Example:
11-12
Examples:
Z
+0000
+00:00
-0800
-08:00
Examples:
2011
0001
Examples:
PT4H18M3S
4h 18m 3s
The empty string is a valid IRI reference, so the empty string is allowed anywhere this reference lists the “URL” datatype as being allowed.
Example:
http://example.org/hello
The empty string is a valid URL, so the empty string is allowed anywhere this reference lists the “URL potentially surrounded by spaces” datatype as being allowed.
Examples:
/hello
#canvas
http://example.org/
any
"0
"
character and that are separated by a single
"x
"
character.Name
or Alias
field
labeled as “preferred MIME name”;
or, if none of the Alias
fields are so labeled, a
case-insensitive match
for a Name
field in the registry.text/html;
".charset=
".UTF-8
".;
"
character.url=
".An unordered set of unique space-separated tokens, each of which is a case-insensitive match for one of the following:
copy
Indicates that dropping an accepted item on the element will result in a copy of the dragged data.
move
Indicates that dropping an accepted item on the element will result in the dragged data being moved to the new location.
link
Indicates that dropping an accepted item on the element will result in a link to the original data.
string:
".
Indicates that Plain Unicode string items, of the type
indicated by the part of of the keyword after the
"string:
"
string, can be dropped on this element.
file:
".
Indicates that File items, of the type
indicated by the part of of the keyword after the
"file:
"
string, can be dropped on this element.
The value must not have more than one of the three tokens
"copy
",
"move
",
or
"link
".
If none are specified, the element represents a
copy
dropzone.
0
".FunctionBody
production
[ECMA 262].allow-forms
"allow-scripts
"allow-top-navigation
"allow-same-origin
"Because an unordered set of unique space-separated tokens can contain zero tokens, this datatype also allows the following:
Example:
1985-04-12T23:20:50.52
1996-12-19T16:39:57
Example:
1996-12-19
-
".Example:
1996-12
-W
".52
or
53
,
depending on the particular year.Example:
1996-W16
1*( atext / "." ) "@" ldh-str 1*( "." ldh-str )
…where atext is as defined in [RFC 5322], and ldh-str is as defined in [RFC 1034].
That is, any string which matches the following regular expression:
/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
Examples:
foo-bar.baz@example.com
#
"
character.0–9
,
a–f
,
and
A–F
.Color keywords (for example, strings such as “red” or “green”) are not allowed.