jump
W3C

HTML: The Markup Language Reference

W3C Working Draft 05 April 2011

This Version:
http://www.w3.org/TR/2011/WD-html-markup-20110405/
Latest Version:
http://www.w3.org/TR/html-markup/
Previous Versions:
http://www.w3.org/TR/2011/WD-html-markup-20110113/
http://www.w3.org/TR/2010/WD-html-markup-20101019/
http://www.w3.org/TR/2010/WD-html-markup-20100624/
http://www.w3.org/TR/2010/WD-html-markup-20100304/
Editor’s Draft:
http://dev.w3.org/html5/markup/
Editors:
Michael(tm) Smith <sideshowbarker@gmail.com>

The content of this document is also available as multiple HTML files.


Abstract

This non-normative reference describes the HTML markup language and provides details to help producers of HTML content create documents that conform to the language. It is intended to complement the normative conformance criteria defined in the HTML5: A vocabulary and associated APIs for HTML and XHTML specification, as well as information in related deliverables published by the HTML Working Group and from other sources. By design, this reference does not describe related APIs in detail, nor attempt to explain how implementations that are consumers of HTML content are meant to process documents (those areas are covered by the HTML5 specification itself), nor attempt to also be a tutorial or “how to” authoring guide.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is the 05 April 2011 Working Draft of HTML: The Markup Language Reference. If you’d like to comment on this document, the preferred means for commenting is to submit your comments through the HTML Working Group bugzilla database, with the Component field set to HTML5: The Markup Language. Alternatively, you can send comments by e-mail to public-html-comments@w3.org (archived).

This document was published by the W3C HTML Working Group, part of the HTML Activity in the W3C Interaction Domain.

Instability and incompleteness of this document

This document is a working draft — all parts of it remain subject to significant change or removal, and some parts are currently incomplete; in particular, many elements currently lack complete documentation in the following subsections:

Examples
The documentation for each element ideally have at least one conformant example and at least one non-conformant example.
Details
The purpose of this subsection is to provide, where needed, additional details about the semantics of the element and its attributes.
Additional constraints and admonitions
This purpose of this subsection is to provide, where needed, additional document-conformance constraints and usage admonitions for the element and its attributes (in addition to those already documented in the Permitted content, Permitted attributes, Permitted parent elements, and Tag omission subsections).

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. This document is informative only. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

Table of Contents # T

Full Table of Contents

1. Introduction # T

This document is a non-normative reference that provides details to help producers of HTML content create conformant documents, and to help others check the conformance of existing documents. It has the following design goals:

The first two of the above design goals make this reference similar in scope to the [HTML5 for Web Authors] subset of the normative [HTML5] full specification.

Certain purposes are intentionally out of scope for this reference document; specifically, it:

For implementation conformance criteria for HTML consumers and detailed information on related APIs, instead see the [HTML5] full specification.

Finally, because this document is intended for use strictly as a reference, it does not attempt to also be a tutorial or “how to” authoring guide.

2. Terminology # T

The following is a list of terms that are used in other sections of this reference.

browsing context
An environment in which UAs present documents to users. A tab or window in a Web browser typically contains a browsing context, as does an iframe, or frame elements in a frameset.
case-insensitive match
An exact comparison of two strings, codepoint for codepoint, except that the characters in the range A-Z and the corresponding characters in the range a-z are considered to also match.
DOM tree
A representation of a document based on the W3C Document Object Model (DOM), as defined in Document Object Model (DOM) Level 3 Core specification, and as explained in the “What is the Document Object Model?” introduction for that specification [DOM Core]. UAs build representations of documents by parsing them and constructing DOM trees from them.
fallback content
Content associated with embedded content, to be used when the embedded content cannot itself be used (for example, when the embedded content is of an unsupported format).
flow content
Flow content consists of flow elements intermixed with normal character data.
HTML producers
HTML authors (that is, people) and applications (such as editors and content management systems) that produce HTML content.
HTML consumers
HTML user agents; that is, applications (such as Web browsers) which consume HTML content.
must
The word must is used in this reference to mark document-conformance requirements that are normatively defined in the HTML5: A vocabulary and associated APIs for HTML and XHTML full specification. [HTML5].

This reference does not itself normatively define any requirements.

newline
Any of the following:
  • a U+000D CARRIAGE RETURN (CR) character
  • a U+000A LINE FEED (LF) character
  • a U+000D CARRIAGE RETURN (CR) followed by a U+000A LINE FEED (LF) character
phrasing content
Consists of phrasing elements intermixed with normal character data.
resolve a URL
To resolve a URL to an absolute URL, as defined in [HTML5].
space
Any of the following:
  • U+0020 SPACE
  • U+0009 CHARACTER TABULATION (tab)
  • U+000A LINE FEED (LF)
  • U+000C FORM FEED (FF)
  • U+000D CARRIAGE RETURN (CR)
top-level browsing context
As defined in [HTML5].
transparent
If the content model of a particular element foo is described as transparent, it means:
  • when element foo is a child of a parent element bar whose content model is allowed to contain flow elements, then the contents of element foo may also contain flow elements
  • when element foo is a child of a parent element baz whose content model restricts its child elements to only being phrasing elements, then any child elements of element foo are also restricted to only being phrasing elements
UA
An HTML user agent; that is, an application (such as a Web browser) which consumes HTML content.

3. Documents # T

This section defines the term document, and provides additional details related to the definition of that term. It is divided into the following parts:

3.1. The HTML language and HTML and XML syntaxes # T

The term document is used in this reference to mean an instance of the HTML language.

The HTML language is the language described in this reference; it is an abstract language that applications can potentially represent in memory in any number of possible ways, and that can be transmitted using any number of possible concrete syntaxes.

This reference describes two particular concrete syntaxes for the HTML language: One syntax, which is referred to throughout this reference as the HTML syntax, and another syntax, which is referred to throughout this reference as the XML syntax. Web browsers typically implement two separate parsers for processing documents: an HTML parser which is invoked when processing documents in the HTML syntax, and an XML parser which is invoked when processing documents in the XML syntax.

The HTML syntax is the syntax described in the HTML syntax section of this reference.

The XML syntax is defined by rules in the [XML] specification and in the [Namespaces In XML] specification; any syntax-level requirements for documents in the XML syntax described in this reference are intended to be the same as those defined in the XML specification.

3.2. The HTML namespace and MIME types # T

The HTML namespace is defined as http://www.w3.org/1999/xhtml. The HTML namespace is the namespace both for documents in the HTML syntax and for documents in the XML syntax.

Documents that are served with the text/html MIME type must match the descriptions in this reference for characteristics of documents in the HTML syntax.

Documents that have an HTML namespace declaration and that are served with an XML MIME type such as text/xml, application/xml, or application/xhtml+xml must match the descriptions in this reference for characteristics of documents in the XML syntax.

3.3. Conformant documents # T

There are two types of conformant documents:

3.3.1. Conformant documents in the HTML syntax #

A conformant document in the HTML syntax must consist of the following parts, in the following order:

  1. Optionally, a single U+FEFF BYTE ORDER MARK (BOM) character.
  2. Any number of comments and space characters.
  3. A doctype.
  4. Any number of comments and space characters.
  5. An html element, with its attributes (if any) and its contents (if any).

    The start tag and end tag of the html element can be omitted—as well as, possibly, the start tags and end tags of certain descendants of the html element—in which case the start tag and end tag are considered to be implied.

  6. Any number of comments and space characters.

Documents in the HTML syntax must match the syntax described in the HTML syntax section of this reference.

3.3.1.1. Implied start tags and end tags #

In documents in the HTML syntax, the start tags and end tags of the html element and particular descendants of the html element can be omitted. In cases where tag omission of those particular elements occurs, the document can still be considered, conceptually, to contain the elements—but with their start tags and end tags implied.

The following is an example of a document with implied start tags and end tags for the html, head, and body elements. Note that it is nevertheless a complete, valid document.

<!DOCTYPE html>
<title>A relatively minimal HTML document</title>
<p>Hello World!</p>

The DOM tree constructed from that example by a conformant UA would look like this:

  • DOCTYPE: html
  • HTML
    • HEAD
      • TITLE
        • #text: A relatively minimal HTML document
      • #text:
    • BODY
      • P
        • #text: Hello World!

Note that the DOM tree includes the html, head, and body elements whose start tags and end tags are implied in the document.

3.3.2. Conformant documents in the XML syntax #

A conformant document in the XML syntax must be a namespace-well-formed XML document, as defined in the [Namespaces in XML] specification, and its root element must be an html element.

Documents in the XML syntax must not make use of any features of the HTML syntax that do not follow XML well-formedness constraints (for example, documents in the XML syntax must not use unquoted attribute value syntax and must not omit tags).

3.4. Case insensitivity in tag names and attribute names # T

In documents in the HTML syntax:

In documents in the XML syntax:

4. HTML syntax # T

This section describes the HTML syntax in detail. In places, it also notes differences between the the HTML syntax and the XML syntax, but it does not describe the XML syntax in detail (the XML syntax is instead defined by rules in the [XML] specification and in the [Namespaces in XML] specification).

This section is divided into the following parts:

4.1. The doctype # T

A doctype (sometimes capitalized as “DOCTYPE”) is an special instruction which, for legacy reasons that have to do with processing modes in browsers, is a required part of any document in the HTML syntax; it must match the characteristics of one of the following three formats:

A normal doctype consists of the following parts, in exactly the following order:

  1. Any case-insensitive match for the string "<!DOCTYPE".
  2. One or more space characters.
  3. Any case-insensitive match for the string "HTML".
  4. Optionally, one or more space characters.
  5. A ">" character.

The following is an example of a conformant normal doctype.

<!DOCTYPE html>

A deprecated doctype consists of the following parts, in exactly the following order:

  1. Any case-insensitive match for the string "<!DOCTYPE".
  2. One or more space characters.
  3. Any case-insensitive match for the string "HTML".
  4. One or more space characters.
  5. Any case-insensitive match for the string "PUBLIC".
  6. One or more space characters.
  7. A quote mark (public ID), consisting of either a """ character or a "'" character.
  8. A permitted public ID
  9. A matching quote mark (public ID), identical to the quote mark (public ID) used earlier (either a """ character or a "'" character).
  10. Conditionally, depending on whether it is part of a permitted-public-ID-system-ID-combination, the following parts, in exactly the following order:
    1. One or more space characters.
    2. A quote mark (system ID), consisting of either a """ character or a "'" character.
    3. A permitted system ID
    4. A matching quote mark (system ID), identical to the quote mark (system ID) used earlier (either a """ character or a "'" character).
  11. Optionally, one or more space characters.
  12. A ">" character.

A permitted-public-ID-system-ID-combination is any combination of a public ID (the first quoted string in the doctype) and system ID (the second quoted string, if any, in the doctype) such that the combination corresponds to one of the six deprecated doctypes in the following list of deprecated doctypes:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

A legacy-tool-compatible doctype consists of the following parts, in exactly the following order:

  1. Any case-insensitive match for the string "<!DOCTYPE".
  2. One or more space characters.
  3. Any case-insensitive match for the string "HTML".
  4. One or more space characters.
  5. Any case-insensitive match for the string "SYSTEM".
  6. One or more space characters
  7. A quote mark, consisting of either a """ character or a "'" character.
  8. The literal string "about:legacy-compat".
  9. A matching quote mark, identical to the quote mark used earlier (either a """ character or a "'" character).
  10. Optionally, one or more space characters.
  11. A ">" character.

The following is examples of a conformant legacy-tool-compatible doctype.

<!doctype HTML system "about:legacy-compat">

4.2. Character encoding declaration # T

A character encoding declaration is a mechanism for specifying the character encoding used to store or transmit a document.

The following restrictions apply to character encoding declarations:

  • The character encoding name given must be the name of the character encoding used to serialize the file.
  • The value must be a valid character encoding name, and must be the preferred name for that encoding, as specified in the IANA [Character Sets] registry.
  • The character encoding declaration must be serialized without the use of character references or character escapes of any kind.
  • The element containing the character encoding declaration must be serialized completely within the first 512 bytes of the document.

If the document does not start with a U+FEFF BYTE ORDER MARK (BOM) character, and if its encoding is not explicitly given by a Content-Type HTTP header, then the character encoding used must be an ASCII-compatible character encoding, and, in addition, if that encoding isn't US-ASCII itself, then the encoding must be specified using a meta element with a charset attribute or a meta element in the encoding declaration state.

If the document contains a meta element with a charset attribute or a meta element in the encoding declaration state, then the character encoding used must be an ASCII-compatible character encoding.

An ASCII-compatible character encoding is one that is a superset of US-ASCII (specifically, ANSI_X3.4-1968) for bytes in the set 0x09, 0x0A, 0x0C, 0x0D, 0x20 - 0x22, 0x26, 0x27, 0x2C - 0x3F, 0x41 - 0x5A, and 0x61 - 0x7A.

Documents should not use UTF-32, JIS_C6226-1983, JIS_X0212-1990, HZ-GB-2312, JOHAB (Windows code page 1361), encodings based on ISO-2022, or encodings based on EBCDIC.

Documents must not use CESU-8, UTF-7, BOCU-1, or SCSU encodings.

In a document in the XML syntax, the XML declaration, as defined in the XML specification [XML] should be used to provide character-encoding information, if necessary.

4.3. Elements # T

An element’s content model defines the element’s structure: What contents (if any) the element can contain, as well as what attributes (if any) the element can have. The HTML elements section of this reference describes the content models for all of elements that are part of the HTML language. An element must not contain contents or attributes that are not part of its content model.

The contents of an element are any elements, character data, and comments that it contains. Attributes and their values are not considered to be the “contents” of an element.

The text content of an element is as defined in Document Object Model (DOM) Level 3 Core [DOM Core].

A void element is an element whose content model never allows it to have contents under any circumstances. Void elements can have attributes.

The following is a complete list of the void elements in HTML:

The following list describes syntax rules for the the HTML syntax. Rules for the the XML syntax are defined in the XML specification [XML].

  • tags are used to delimit the start and end of elements in markup. Elements have a start tag to indicate where they begin. Non-void elements have an end tag to indicate where they end.
  • tag names are used within element start tags and end tags to give the element’s name. HTML elements all have names that only use characters in the range 0–9, a–z, and A–Z.
  • start tags consist of the following parts, in exactly the following order:
    1. A "<" character.
    2. The element’s tag name.
    3. Optionally, one or more attributes, each of which must be preceded by one or more space characters.
    4. Optionally, one or more space characters.
    5. Optionally, a "/" character, which may be present only if the element is a void element.
    6. A ">" character.
  • end tags consist of the following parts, in exactly the following order:
    1. A "<" character.
    2. A "/" character
    3. The element’s tag name.
    4. Optionally, one or more space characters.
    5. A ">" character.
  • Void elements only have a start tag; end tags must not be specified for void elements.
  • The start and end tags of certain elements can be omitted. The subsection for each element in the HTML elements section of this reference provides information about which tags (if any) can be omitted for that particular element.
  • A non-void element must have an end tag, unless the subsection for that element in the HTML elements section of this reference indicates that its end tag can be omitted.
  • The contents of an element must be placed between just after its start tag (which might be implied, in certain cases) and just before its end tag (which might be implied in certain cases).

4.3.1. Misnested tags #

If an element has both a start tag and an end tag, its end tag must be contained within the contents of the same element in which its start tag is contained. An end tag that is not contained within the same contents as its start tag is said to be a misnested tag.

In the following example, the "</i>" end tag is a misnested tag, because it is not contained within the contents of the b element that contains its corresponding "<i>" start tag.

<b>foo <i>bar</b> baz</i>

4.4. Attributes # T

attributes for an element are expressed inside the element’s start tag. Attributes have a name and a value.

There must never be two or more attributes on the same start tag whose names are a case-insensitive match for each other.

The following list describes syntax rules for attributes in documents in the HTML syntax. Syntax rules for attributes in documents in the XML syntax. are defined in the XML specification [XML].

  • attribute names must consist of one or more characters other than the space characters, U+0000 NULL, """, "'", ">", "/", "=", the control characters, and any characters that are not defined by Unicode.
  • XML-compatible attribute names are those that match the Name production defined in the XML specification [XML] and that contain no ":" characters, and whose first three characters are not a case-insensitive match for the string "xml".
  • attribute values, in general, are normal character data; however, the HTML elements section of this reference describes further restrictions on the allowed values of particular attributes, and attributes must have values that conform to those restrictions.

In the the HTML syntax, attributes can be specified in four different ways:

  1. empty attribute syntax
  2. unquoted attribute-value syntax
  3. single-quoted attribute-value syntax
  4. double-quoted attribute-value syntax
empty attribute syntax

Certain attributes may be specified by providing just the attribute name, with no value.

In the following example, the disabled attribute is given with the empty attribute syntax:

<input disabled>
unquoted attribute-value syntax

An unquoted attribute value is specified by providing the following parts in exactly the following order:

  1. an attribute name
  2. zero or more space characters
  3. a single "=" character
  4. zero or more space characters
  5. an attribute value

In addition to the general requirements given above for attribute values, an unquoted attribute value has the following restrictions:

In the following example, the value attribute is given with the unquoted attribute value syntax:

<input value=yes>

If the value of an attribute using the unquoted attribute syntax is followed by a "/" character, then there must be at least one space character after the value and before the "/" character.

single-quoted attribute-value syntax

A single-quoted attribute value is specified by providing the following parts in exactly the following order:

  1. an attribute name
  2. zero or more space characters
  3. a "=" character
  4. zero or more space characters
  5. a single "'" character
  6. an attribute value
  7. a "'" character.

In addition to the general requirements given above for attribute values, a single-quoted attribute value has the following restriction:

  • must not contain any literal "'" characters

In the following example, the type attribute is given with the single-quoted attribute value syntax:

<input type='checkbox'>
double-quoted attribute-value syntax

A double-quoted attribute value is specified by providing the following parts in exactly the following order:

  1. an attribute name
  2. zero or more space characters
  3. a single "=" character
  4. zero or more space characters
  5. a single """ character
  6. an attribute value
  7. a """ character

In addition to the general requirements given above for attribute values, a double-quoted attribute value has the following restriction:

  • must not contain any literal """ characters

In the following example, the title attribute is given with the double-quoted attribute value syntax:

<code title="U+003C LESS-THAN SIGN">&lt;</code>

4.5. Text and character data # T

text in element contents (including in comments) and attribute values must consist of Unicode characters, with the following restrictions:

  • must not contain U+0000 characters
  • must not contain permanently undefined Unicode characters
  • must not contain control characters other than space characters

character data contains text, in some cases in combination with character references, along with certain additional restrictions. There are three types of character data that can occur in documents:

  1. normal character data
  2. replaceable character data
  3. non-replaceable character data
normal character data

Certain elements and strings in the values of particular attributes contain normal character data. Normal character data can contain the following:

Normal character data has the following restrictions:

  • must not contain any "<" characters
replaceable character data

In documents in the HTML syntax, the title and textarea elements can contain replaceable character data. Replaceable character data can contain the following:

Replaceable character data has the following restrictions:

Replaceable character data, as described in this reference, is a feature of the HTML syntax that is not available in the XML syntax. Documents in the XML syntax must not contain replaceable character data as described in this reference; instead they must conform to all syntax constraints described in the XML specification [XML].

non-replaceable character data

In documents in the HTML syntax, the script, and style elements can contain non-replaceable character data. Non-replaceable character data can contain the following:

Non-replaceable character data has the following restrictions:

Non-replaceable character data, as described in this reference, is a feature of the HTML syntax that is not available in the XML syntax. Documents in the XML syntax must not contain non-replaceable character data as described in this reference; instead they must conform to all syntax constraints defined in the XML specification [XML].

4.6. Character references # T

character references are a form of markup for representing single individual characters. There are three types of character references:

named character reference

Named character references consist of the following parts in exactly the following order:

  1. An "&" character.
  2. One of the entity names listed in the “Named character references” section of the HTML5 specification [HTML5], using the same case.
  3. A ";" character.

For further information about named character references, see [XML Entities].

The following is an example of a named character reference for the character "" (U+2020 DAGGER).

&dagger;
decimal numeric character reference

Decimal numerical character references consist of the following parts, in exactly the following order.

  1. An "&" character.
  2. A "#" character.
  3. One or more digits in the range 0–9, representing a base-ten integer that itself is a Unicode code point that is not U+0000, U+000D, in the range U+0080–U+009F, or in the range 0xD8000–0xDFFF (surrogates).
  4. A ";" character.

The following is an example of a decimal numeric character reference for the character "" (U+2020 DAGGER).

&#8224;
hexadecimal numeric character reference

Hexadecimal numeric character references consist of the following parts, in exactly the following order.

  1. An "&" character.
  2. A "#" character.
  3. Either a "x" character or a "X" character.
  4. One or more digits in the range 0–9, a–f, and A–F, representing a base-sixteen integer that itself is a Unicode code point that is not U+0000, U+000D, in the range U+0080–U+009F, or in the range 0xD800–0xDFFF (surrogates).
  5. A ";" character.

The following is an example of a hexadecimal numeric character reference for the character "" (U+2020 DAGGER).

&#x2020;

Character references are not themselves text, and no part of a character reference is text.

An ambiguous ampersand is an "&" character that is followed by some text other than a space character, a "<", character, or another "&" character.

4.7. Comments # T

comments consist of the following parts, in exactly the following order:

  1. the comment start delimiter "<!--"
  2. text
  3. the comment end delimiter "-->"

The text part of comments has the following restrictions:

  • must not start with a ">" character
  • must not start with the string "->"
  • must not contain the string "--"
  • must not end with a "-" character

The following is an example of a comment.

<!-- main content starts here -->

4.8. SVG and MathML elements in HTML documents # T

SVG and MathML elements are elements from the SVG and MathML namespaces. SVG and MathML elements can be used both in documents in the HTML syntax and in documents in the XML syntax. Syntax rules for SVG and MathML elements in documents in the XML syntax are defined in the XML specification [XML]. The following list describes additional syntax rules that specifically apply to SVG and MathML elements in documents in the HTML syntax.

4.9. CDATA sections in SVG and MathML contents # T

CDATA sections in SVG and MathML contents in documents in the HTML syntax consist of the following parts, in exactly the following order:

  1. the CDATA start delimiter "<![CDATA["
  2. text, with the additional restriction that the text must not contain the string "]]>
  3. the CDATA end delimiter "]]>"

CDATA sections are allowed only in the contents of elements from the SVG and MathML namespaces.

The following shows an example of a CDATA section.

<annotation encoding="text/latex">
  <![CDATA[\documentclass{article}
  \begin{document}
  \title{E}
  \maketitle
  The base of the natural logarithms, approximately 2.71828.
  \end{document}]]>
</annotation>

5. HTML elements organized by function # T

This section provides an index of HTML elements organized into groups according to function.

5.1. The root element #

6. HTML elements # T

The complete set of HTML elements is the set of elements described in the following sections.

ahyperlink CHANGED # T

The a element represents a hyperlink.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
name = ID OBSOLETE #
Specifies that its a element is a named hyperlink, with the name given by the value of this attribute.
The name attribute on the a element is obsolete. Consider putting an id attribute on the nearest container instead.
Any string, with the following restrictions:

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).

href = URL potentially surrounded by spaces #
A URL that provides the destination of the hyperlink. If the href attribute is not specified, the element represents a placeholder hyperlink.
target = browsing-context name or keyword CHANGED #
A name or keyword giving a browsing context for UAs to use when following the hyperlink.
The target attribute on the a element was deprecated in a previous version of HTML, but is no longer deprecated, as it useful in Web applications, particularly in combination with the iframe element.
Any string that is either of the following:
rel = set of space-separated tokens #
A list of tokens that specify the relationship between the document containing the hyperlink and the destination indicated by the hyperlink.
hreflang = language tag #
The language of the destination of the hyperlink.
A valid language tag as defined in [BCP 47].
media = media-query list NEW #
The media for which the destination of the hyperlink was designed.
A valid media query list as defined in [Media Queries].
type = MIME type #
The MIME type of the destination of the hyperlink.
A string that identifies a valid MIME media type as defined in [RFC 2046].

Additional constraints and admonitions #

  • The interactive element a must not appear as a descendant of the a element.
  • The interactive element a must not appear as a descendant of the button element.
  • The coords attribute on the a element is obsolete. For image maps, use the area element instead of the a element.
  • The shape attribute on the a element is obsolete. For image maps, use the area element instead of the a element.
  • The urn attribute on the a element is obsolete. Specify the preferred persistent identifier using the href attribute instead.
  • The charset attribute on the a element is obsolete. Use an HTTP Content-Type header on the linked resource instead.
  • The methods attribute on the a element is obsolete. Use the HTTP OPTIONS feature instead.
  • The rev attribute on the a element is obsolete. Use the rel attribute instead, with a term having the opposite meaning.

Tag omission #

An a element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements, any element that can contain flow elements

Changes in HTML5 #

Although previous versions of HTML restricted the a element to only containing phrasing content (essentially, what was in previous versions referred to as “inline” content), the a element is now transparent; that is, an instance of the a element is now allowed to also contain flow content (essentially, what was in previous versions referred to as “block” content)—if the parent element of that instance of the a element is an element that is allowed to contain flow content.

Details #

If the contents of an a element are empty, the element represents an empty hyperlink.

DOM interface #

interface HTMLAnchorElement : HTMLElement {
  stringifier attribute DOMString href;
           attribute DOMString target;
           attribute DOMString rel;
  readonly attribute DOMTokenList relList;
           attribute DOMString media;
           attribute DOMString hreflang;
           attribute DOMString type;

           attribute DOMString text;

  // URL decomposition IDL attributes
           attribute DOMString protocol;
           attribute DOMString host;
           attribute DOMString hostname;
           attribute DOMString port;
           attribute DOMString pathname;
           attribute DOMString search;
           attribute DOMString hash;
};

Typical default display properties #

a:link, a:visited {
color: (internal value);
text-decoration: underline;
cursor: auto; }
a:link:active, a:visited:active {
color: (internal value); }

Examples #

A hyperlink intended to be useful in output for all media types except the print media type.

<a href="./page2.html" rel=next media="not print">next</a>

The name attribute is obsolete.

<a name="section5"/>

A placeholder hyperlink.

<a>prev</a>

A hyperlink that will cause its target to be opened in a new browsing context.

<a href="http://help.example.com" target="_blank">Help</a>

The value of the href attribute contains a space character.

some <a href="http://example.com/Archive/Public Data/">public</a> data is also available

A hyperlink that represents multiple link types.

<a href="../toc.html" rel="index up">up</a>

A hyperlink that contains a paragraph.

<a href="javascript:void(0);"
  onmouseover="return anno('Note: This paragraph is informative only.')
  onmouseout="return anno_bye();">
<p>The following is introductory information…</p>
</a>

abbrabbreviation # T

The abbr element represents an abbreviation or acronym.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

An abbr element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Details #

The title attribute on the abbr element represents the expansion of the abbreviation or acronym.

DOM interface #

Uses HTMLElement.

addresscontact information # T

The address element represents contact information.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The address element must not contain any nested address elements.

Tag omission #

An address element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

Details #

If an address element applies to a body element, then it represents contact information for the document as a whole. If an address element applies to a section of a document, then it represents contact information for that section only.

DOM interface #

Uses HTMLElement.

Typical default display properties #

address {
display: block; }
address {
font-style: italic; }

areaimage-map hyperlink # T

The area element represents either a hyperlink with some text and a corresponding area on an image map, or a dead area on an image map.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes & alt & href & target & rel & media & hreflang & type & shape="rect" & coords or shape="circle" & coords or shape="poly" & coords or shape="default"

global attributes
Any attributes permitted globally.
alt = normal character data #
The fallback content for the image map.
href = URL potentially surrounded by spaces #
A URL that provides the destination of the hyperlink for this area.
target = browsing-context name or keyword #
A name or keyword giving a browsing context for UAs to use when following the hyperlink for this area.
Any string that is either of the following:
rel = set of space-separated tokens NEW #
A list of tokens that specify the relationship between the document containing the area and the destination indicated by the area.
media = media-query list NEW #
The media for which the destination of the hyperlink was designed.
A valid media query list as defined in [Media Queries].
hreflang = language tag NEW #
The language of the destination of the hyperlink.
A valid language tag as defined in [BCP 47].
type = MIME type #
The MIME type of the destination of the hyperlink.
A string that identifies a valid MIME media type as defined in [RFC 2046].
shape = "rect" & coords = rectangle coordinates # #
Specifies that the shape of the area of this hyperlink on the image map is a rectangle.
A comma-separated list of four integers, in exactly the following order:
  1. an integer representing the distance in CSS pixels from the left edge of the image to the left side of the rectangle
  2. an integer representing the distance in CSS pixels from the top edge of the image to the top side of the rectangle
  3. an integer, greater than the value of the first integer in this list, representing the distance in CSS pixels from the left edge of the image to the right side of the rectangle
  4. an integer, greater than the value of the second integer in this list, representing the distance in CSS pixels from the top edge of the image to the bottom side of the rectangle
shape = "circle" & coords = circle coordinates # #
Specifies that the shape of the area of this hyperlink on the image map is a circle.
A comma-separated list of three numbers, in exactly the following order:
  1. an integer representing the distance in CSS pixels from the left edge of the image to the center of the circle
  2. an integer representing the distance in CSS pixels from the top edge of the image to the center of the circle
  3. a non-negative integer, representing the radius of the circle, in CSS pixels
shape = "poly" & coords = polygon coordinates # #
Specifies that the shape of the area of this hyperlink on the image map is a polygon.
A comma-separated list of at least six integers, with the total number of integers in the list being even (that is, six or eight or ten numbers, and so on). Each pair of integers represents a coordinate, in CSS pixels, given as the distances from, respectively, the left and the top of the image; all the coordinates together represent the points of the polygon, in order.
shape = "default" #
Specifies that the shape of the area of this hyperlink on the image map is a rectangle that exactly covers the entire image.

Additional constraints and admonitions #

  • The area element must have an ancestor map element.
  • The nohref attribute on the area element is obsolete. Omitting the href attribute is sufficient.

Tag omission #

The area element is a void element. An area element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLAreaElement : HTMLElement {
           attribute DOMString alt;
           attribute DOMString coords;
           attribute DOMString shape;
  stringifier attribute DOMString href;
           attribute DOMString target;
           attribute DOMString rel;
  readonly attribute DOMTokenList relList;
           attribute DOMString media;
           attribute DOMString hreflang;
           attribute DOMString type;

  // URL decomposition IDL attributes
           attribute DOMString protocol;
           attribute DOMString host;
           attribute DOMString hostname;
           attribute DOMString port;
           attribute DOMString pathname;
           attribute DOMString search;
           attribute DOMString hash;
};

Typical default display properties #

area {
display: none; }

articlearticle NEW # T

The article element represents a section of content that forms an independent part of a document or site; for example, a magazine or newspaper article, or a blog entry.

Permitted contents #

zero or more style elements, followed by flow content

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The sectioning element article must not appear as a descendant of the address element.

Tag omission #

An article element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

article {
display: block; }

asidetangential content NEW # T

The aside element represents content that is tangentially related to the content that forms the main textual flow of a document.

Permitted contents #

zero or more style elements, followed by flow content

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The sectioning element aside must not appear as a descendant of the address element.

Tag omission #

An aside element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

Details #

In printed documents, the type of tangential content that the aside element represents is sometimes formatted as a sidebar or annotation or footnote.

DOM interface #

Uses HTMLElement.

Typical default display properties #

aside {
display: block; }

audioaudio stream NEW # T

An audio element represents an audio stream.

Permitted contents #

Transparent, with the following specific structure:

a src attribute, or one or more source elements followed by zero or more track elements, followed by flow content

or

a src attribute, or one or more source elements followed by zero or more track elements, followed by phrasing content

Permitted attributes #

global attributes
Any attributes permitted globally.
autoplay = "autoplay" or "" (empty string) or empty #
Instructs the UA to automatically begin playback of the audio stream as soon as it can do so without stopping.
preload = "none" or "metadata" or "auto" or "" (empty string) or empty #
Represents a hint to the UA about whether optimistic downloading of the audio stream itself or its metadata is considered worthwhile.
  • "none": Hints to the UA that the user is not expected to need the audio stream, or that minimizing unnecessary traffic is desirable.
  • "metadata": Hints to the UA that the user is not expected to need the audio stream, but that fetching its metadata (duration and so on) is desirable.
  • "auto": Hints to the UA that optimistically downloading the entire audio stream is considered desirable.
Specifying the empty string is equivalent to specifying the value "auto".
controls = "controls" or "" (empty string) or empty #
Instructs the UA to expose a user interface for controlling playback of the audio stream.
loop = "loop" or "" (empty string) or empty #
Instructs the UA to seek back to the start of the audio stream upon reaching the end.
src = Non-empty URL potentially surrounded by spaces #
The URL for the audio stream.

Additional constraints and admonitions #

  • The interactive element audio with the attribute controls must not appear as a descendant of the a element.
  • The interactive element audio with the attribute controls must not appear as a descendant of the button element.

Tag omission #

An audio element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements, any element that can contain flow elements

DOM interface #

[NamedConstructor=Audio(),
 NamedConstructor=Audio(in DOMString src)]
interface HTMLAudioElement : HTMLMediaElement {};

boffset text conventionally styled in bold CHANGED # T

The b element represents a span of text offset from its surrounding content without conveying any extra emphasis or importance, and for which the conventional typographic presentation is bold text; for example, keywords in a document abstract, or product names in a review.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A b element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Changes in HTML5 #

Although previous versions of HTML defined the b element only in presentational terms, the element has now been given the specific semantic purpose of representing text “offset from its surrounding content without conveying any extra emphasis or importance, and for which the conventional typographic presentation is bold text”.

DOM interface #

Uses HTMLElement.

Typical default display properties #

b {
font-weight: bolder; }

basebase URL # T

The base element specifies a document-wide base URL for the purposes of resolving relative URLs, and a document-wide default browsing context name for the purposes of following hyperlinks.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
href = URL potentially surrounded by spaces #
The base URL for the document.
target = browsing-context name or keyword NEW #
A browsing context name or keyword for use in following hyperlinks.
Any string that is either of the following:

Tag omission #

The base element is a void element. A base element must have a start tag but must not have an end tag.

Permitted parent elements #

head

DOM interface #

interface HTMLBaseElement : HTMLElement {
           attribute DOMString href;
           attribute DOMString target;
};

bdiBiDi isolate NEW # T

The bdi element represents a span of text that is isolated from its surroundings for the purposes of bidirectional text formatting [BIDI].

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A bdi element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

bdoBiDi override # T

The bdo element represents an explicit text directionality formatting control for its children; it provides a means to specify a direction override of the Unicode BiDi algorithm [BIDI].

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • A bdo element must have a dir attribute.

Tag omission #

A bdo element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

blockquoteblock quotation # T

The blockquote element represents a section that is quoted from another source.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
cite = URL potentially surrounded by spaces #
A URL referencing the original source for the quoted material.

Tag omission #

A blockquote element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

interface HTMLQuoteElement : HTMLElement {
           attribute DOMString cite;
};

Typical default display properties #

blockquote {
display: block;
margin: 1em 40px 1em 40px; }

bodydocument body # T

The body element represents the body of a document (as opposed to the document’s metadata).

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
onafterprint = string NEW #
User printed current document.
onbeforeprint = string NEW #
User requested printing of current document.
onbeforeunload = string NEW #
Document is about to be unloaded.
onblur = string #
Document lost focus.
onerror = string NEW #
Document failed to load properly.
onfocus = string #
Document received focus.
onhashchange = string NEW #
Fragment identifier part of the document’s current address changed.
onload = string #
Document finished loading.
onmessage = string NEW #
Document received a message.
onoffline = string NEW #
Network connections failed.
ononline = string NEW #
Network connections returned.
onpopstate = string NEW #
User navigated session history.
onredo = string NEW #
User went forward in undo transaction history.
onresize = string NEW #
Document view was resized.
onstorage = string NEW #
Storage area changed.
onundo = string NEW #
User went backward in undo transaction history.
onunload = string #
Document is going away.

Additional constraints and admonitions #

Tag omission #

A body element’s start tag may be omitted if the first thing inside the body element is not a space character or a comment, except if the first thing inside the body element is a script or style element.

A body element’s end tag may be omitted if the body element is not immediately followed by a comment and the element is either not empty or its start tag has not been omitted.

Permitted parent elements #

html

DOM interface #

interface HTMLBodyElement : HTMLElement {
           attribute Function onafterprint;
           attribute Function onbeforeprint;
           attribute Function onbeforeunload;
           attribute Function onblur;
           attribute Function onerror;
           attribute Function onfocus;
           attribute Function onhashchange;
           attribute Function onload;
           attribute Function onmessage;
           attribute Function onoffline;
           attribute Function ononline;
           attribute Function onpopstate;
           attribute Function onpagehide;
           attribute Function onpageshow;
           attribute Function onredo;
           attribute Function onresize;
           attribute Function onscroll;
           attribute Function onstorage;
           attribute Function onundo;
           attribute Function onunload;
};

Typical default display properties #

body {
display: block;
margin: 8px; }
body:focus {
outline: none; }

brline break # T

The br element represents a line break.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

The br element is a void element. A br element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLBRElement : HTMLElement {};

buttonbutton # T

The button element is a multipurpose element for representing buttons.

The details of the button element are described in the following sections:

A button element with no type attribute specified represents the same thing as a button element with its type attribute set to "submit".

button type=submitsubmit button # T

The button element with a type attribute whose value is "submit" represents a button for submitting a form.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "submit" #
Specifies that its button element is a button for submitting a form.
value = string #
The value part of the name/value pair associated with this button for the purposes of form submission.
formaction = URL potentially surrounded by spaces NEW #
The form-submission action for the element.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
formenctype = "application/x-www-form-urlencoded" or "multipart/form-data" or "text/plain" NEW #
A MIME type with which a UA is meant to associate this element for form submission.
formmethod = "get" or "post" NEW #
The HTTP method with which a UA is meant to associate this element for form submission.
formtarget = browsing-context name or keyword NEW #
A browsing context name or keyword that represents the target of the control.
Any string that is either of the following:
formnovalidate = "formnovalidate" or "" (empty string) or empty NEW #
Specifies that the element represents a control whose value is not meant to be validated during form submission.

Additional constraints and admonitions #

  • The interactive element button must not appear as a descendant of the a element.
  • The interactive element button must not appear as a descendant of the button element.
  • Any button element descendant of a label element with a for attribute must have an ID value that matches that for attribute.

Tag omission #

A button element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLButtonElement : HTMLElement {
           attribute boolean autofocus;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute DOMString formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString name;
           attribute DOMString type;
           attribute DOMString value;

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;
};

button type=resetreset button # T

The button element with a type attribute whose value is "reset" represents a button for resetting a form.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "reset" #
Specifies that its button element is a button for resetting a form.
value = string #
The value part of the name/value pair associated with this button for the purposes of form submission.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.

Additional constraints and admonitions #

  • The interactive element button must not appear as a descendant of the a element.
  • The interactive element button must not appear as a descendant of the button element.
  • Any button element descendant of a label element with a for attribute must have an ID value that matches that for attribute.

Tag omission #

A button element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLButtonElement : HTMLElement {
           attribute boolean autofocus;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute DOMString formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString name;
           attribute DOMString type;
           attribute DOMString value;

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;
};

button type=buttonbutton with no additional semantics # T

The button element with a type attribute whose value is "button" represents a button with no additional semantics.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "button" #
Specifies that its button element is a button with no additional semantics.
value = string #
The value part of the name/value pair associated with this button for the purposes of form submission.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.

Additional constraints and admonitions #

  • The interactive element button must not appear as a descendant of the a element.
  • The interactive element button must not appear as a descendant of the button element.
  • Any button element descendant of a label element with a for attribute must have an ID value that matches that for attribute.

Tag omission #

A button element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLButtonElement : HTMLElement {
           attribute boolean autofocus;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute DOMString formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString name;
           attribute DOMString type;
           attribute DOMString value;

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;
};

canvascanvas for dynamic graphics NEW # T

The canvas element represents a resolution-dependent bitmap canvas, which can be used for dynamically rendering of images such as game graphics, graphs, or other images.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
height = non-negative integer #
The height of the canvas, in CSS pixels.
width = non-negative integer #
The width of the canvas, in CSS pixels.

Tag omission #

A canvas element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements, any element that can contain flow elements

DOM interface #

interface HTMLCanvasElement : HTMLElement {
           attribute unsigned long width;
           attribute unsigned long height;

  DOMString toDataURL(in optional DOMString type, in any... args);

  object getContext(in DOMString contextId, in any... args);
};

captiontable title # T

The caption element represents the title of the table that is its parent.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

A caption element must have both a start tag and an end tag.

Permitted parent elements #

table

DOM interface #

interface HTMLTableCaptionElement : HTMLElement {};

Typical default display properties #

caption {
display: table-caption;
text-align: center; }

citecited title of a work CHANGED # T

The cite element represents the cited title of a work; for example, the title of a book mentioned within the main text flow of a document.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A cite element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Changes in HTML5 #

Although previous versions of HTML implied that the cite element can be used to mark up the name of a person, that usage is no longer considered conforming. The cite element now solely represents the cited title of a work; for example, the title of a book, paper, essay, poem, score, song, script, film, TV show, game, sculpture, painting, theater production, play, opera, musical, exhibition, legal case report, or other such work.

DOM interface #

Uses HTMLElement.

Typical default display properties #

cite {
font-style: italic; }

codecode fragment # T

The code element represents a fragment of computer code.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A code element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

code {
font-family: monospace; }

coltable column # T

The col element represents one or more columns in the column group represented by its colgroup parent.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
span = positive integer #
Specifies the number of columns “spanned” by its col element; the col element shares its attributes with all the columns it spans.

Additional constraints and admonitions #

Tag omission #

The col element is a void element. A col element must have a start tag but must not have an end tag.

Permitted parent elements #

colgroup

DOM interface #

interface HTMLTableColElement : HTMLElement {
           attribute unsigned long span;
};

Typical default display properties #

col {
display: table-column; }

colgrouptable column group # T

The colgroup element represents a group of one or more columns in the table that is its parent.

Permitted contents #

zero or more col elements, or an optional span attribute

Permitted attributes #

global attributes
Any attributes permitted globally.
span = positive integer #
The number of columns in the group.

Additional constraints and admonitions #

Tag omission #

A colgroup element's start tag may be omitted if the first thing inside the colgroup element is a col element, and if the element is not immediately preceded by another colgroup element whose end tag has been omitted.

A colgroup element’s end tag may be omitted if the colgroup element is not immediately followed by a space character or a comment.

Permitted parent elements #

table

DOM interface #

interface HTMLTableColElement : HTMLElement {
           attribute unsigned long span;
};

Typical default display properties #

colgroup {
display: table-column-group; }

commandcommand NEW # T

The command element is a multipurpose element for representing commands.

The details of the command element are described in the following sections:

A command element with no type attribute specified represents the same thing as a command element with its type attribute set to "command".

command type=commandcommand with an associated action NEW # T

The command element with a type attribute whose value is "command" represents a command with an associated action.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
type = "command" #
Specifies that its command element is a command with an associated action.
label = string #
The name of the command, as shown to the user.
icon = URL potentially surrounded by spaces #
A URL for an image that represents the command.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the command is not currently available.

Tag omission #

The command element is a void element. A command element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain metadata elements, any element that can contain phrasing elements

DOM interface #

interface HTMLCommandElement : HTMLElement {
           attribute DOMString type;
           attribute DOMString label;
           attribute DOMString icon;
           attribute boolean disabled;
           attribute boolean checked;
           attribute DOMString radiogroup;
};

command type=radioselection of one item from a list of items NEW # T

The command element with a type attribute whose value is "radio" represents a selection of one item from a list of items.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
type = "radio" #
Specifies that its command element represents a selection of one item from a list of items.
radiogroup = string #
The name of the group of commands that will be toggled when the command itself is toggled.
checked = "checked" or "" (empty string) or empty #
Specifies that the command is selected.
label = string #
The name of the command, as shown to the user.
icon = URL potentially surrounded by spaces #
A URL for an image that represents the command.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the command is not currently available.

Tag omission #

The command element is a void element. A command element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain metadata elements, any element that can contain phrasing elements

DOM interface #

interface HTMLCommandElement : HTMLElement {
           attribute DOMString type;
           attribute DOMString label;
           attribute DOMString icon;
           attribute boolean disabled;
           attribute boolean checked;
           attribute DOMString radiogroup;
};

command type=checkboxstate or option that can be toggled NEW # T

The command element with a type attribute whose value is "checkbox" represents a state or option that can be toggled.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
type = "checkbox" #
Specifies that its command element represents a state or option that can be toggled.
checked = "checked" or "" (empty string) or empty #
Specifies that the command is selected.
label = string #
The name of the command, as shown to the user.
icon = Non-empty URL potentially surrounded by spaces #
A URL for an image that represents the command.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the command is not currently available.

Tag omission #

The command element is a void element. A command element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain metadata elements, any element that can contain phrasing elements

DOM interface #

interface HTMLCommandElement : HTMLElement {
           attribute DOMString type;
           attribute DOMString label;
           attribute DOMString icon;
           attribute boolean disabled;
           attribute boolean checked;
           attribute DOMString radiogroup;
};

datalistpredefined options for other controls NEW # T

The datalist element represents a set of option elements that represent predefined options for other controls.

Permitted contents #

zero or more option elements, intermixed with phrasing content

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A datalist element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Details #

The contents of the datalist element represent fallback content for legacy user agents, intermixed with option elements that represent the predefined options.

DOM interface #

interface HTMLDataListElement : HTMLElement {
  readonly attribute HTMLCollection options;
};

Typical default display properties #

datalist {
display: none; }

dddescription or value # T

The dd element represents a description or value.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A dd element must have a start tag.

A dd element’s end tag may be omitted if the dd element is immediately followed by another dd element or a dd element, or if there is no more content in the parent element.

Permitted parent elements #

dl

Details #

The dd element represents the description or value part of a term-description (name-value) grouping in a description list.

DOM interface #

Uses HTMLElement.

Typical default display properties #

dd {
display: block;
margin-start: 40px; }

deldeleted text # T

The del element represents a range of text that has been deleted from a document.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
cite = URL potentially surrounded by spaces #
The address of a document that explains why the text was deleted.
datetime = date and time or date #
The date and time when the text was deleted.
A valid date-time as defined in [RFC 3339], with these additional qualifications:
  • the literal letters T and Z in the date/time syntax must always be uppercase
  • the date-fullyear production is instead 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
A valid full-date as defined in [RFC 3339], with the additional qualification that the year component is four or more digits representing a number greater than 0.

Example:

1996-12-19

Tag omission #

A del element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements, any element that can contain flow elements

DOM interface #

interface HTMLModElement : HTMLElement {
           attribute DOMString cite;
           attribute DOMString dateTime;
};

Typical default display properties #

del {
text-decoration: line-through; }

detailscontrol for additional on-demand information NEW # T

The details element represents a control from which the user can obtain additional information or controls on-demand.

Permitted contents #

an optional summary element, followed by flow content

Permitted attributes #

global attributes
Any attributes permitted globally.
open = "open" or "" (empty string) or empty #
Specifies that the contents of the details element should be shown to the user.

Additional constraints and admonitions #

  • The interactive element details must not appear as a descendant of the a element.
  • The interactive element details must not appear as a descendant of the button element.

Tag omission #

A details element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

interface HTMLDetailsElement : HTMLElement {
           attribute boolean open;
};

dfndefining instance # T

The dfn element represents the defining instance of a term.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The dfn element must not contain any nested dfn elements.

Tag omission #

A dfn element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

divgeneric flow container # T

The div element is a generic container for flow content that by itself does not represent anything.

Permitted contents #

zero or more style elements, followed by flow content

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

A div element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

Details #

The div can be used with attributes such as class, lang, xml:lang, and title to add additional semantics and structure to flow content.

DOM interface #

interface HTMLDivElement : HTMLElement {};

Typical default display properties #

div {
display: block; }

dldescription list # T

The dl element represents a description list.

Permitted contents #

zero or more of: one or more dt elements, followed by one or more dd elements

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

A dl element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

Details #

The dl element represents a description list, which consists of zero or more term-description (name-value) groupings; each grouping associates one or more terms/names (the contents of dt elements) with one or more descriptions/values (the contents of dd elements).

DOM interface #

interface HTMLDListElement : HTMLElement {};

Typical default display properties #

dl {
display: block;
-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
margin-start: 0;
-webkit-margin-end: 0; }

dtterm or name # T

The dt element represents a term or name.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A dt element must have a start tag.

A dt element’s end tag may be omitted if the dt element is immediately followed by another dt element or a dd element.

Permitted parent elements #

dl

Details #

The dt element represents the term or name part of a term-description (name-value) grouping in a description list.

DOM interface #

Uses HTMLElement.

Typical default display properties #

dt {
display: block; }

ememphatic stress # T

The em element represents a span of text with emphatic stress.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

An em element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

em {
font-style: italic; }

embedintegration point for plugins NEW # T

The embed element represents an integration point for external content.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes & src & type & height & width & Any other attribute that has no namespace
global attributes
Any attributes permitted globally.
src = Non-empty URL potentially surrounded by spaces #
The address of the content being embedded.
type = MIME type #
The MIME type of the plugin to instantiate.
A string that identifies a valid MIME media type as defined in [RFC 2046].
height = non-negative integer #
The height of the embedded content, in CSS pixels.
width = non-negative integer #
The width of the embedded content, in CSS pixels.

Additional constraints and admonitions #

  • The interactive element embed must not appear as a descendant of the a element.
  • The interactive element embed must not appear as a descendant of the button element.
  • The name attribute on the embed element is obsolete. Use the id attribute instead.
  • The align attribute on the embed element is obsolete. Use CSS instead.
  • The hspace attribute on the embed element is obsolete. Use CSS instead.
  • The vspace attribute on the embed element is obsolete. Use CSS instead.

Tag omission #

The embed element is a void element. An embed element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Details #

The embed element represents an integration point for external content — typically, non-HTML content such as an application or some other type of interactive content which involves use of a third-party plugin as a handler (rather than being natively supported by the UA).

DOM interface #

interface HTMLEmbedElement : HTMLElement {
           attribute DOMString src;
           attribute DOMString type;
           attribute DOMString width;
           attribute DOMString height;
};

fieldsetset of related form controls # T

The fieldset element represents a set of form controls grouped under a common name.

Permitted contents #

an optional legend element, followed by flow content

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.

Tag omission #

A fieldset element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

interface HTMLFieldSetElement : HTMLElement {
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
           attribute DOMString name;

  readonly attribute DOMString type;

  readonly attribute HTMLFormControlsCollection elements;

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);
};

Typical default display properties #

fieldset {
display: block;
margin-start: 2px;
-webkit-margin-end: 2px;
-webkit-padding-before: 0.35em;
padding-start: 0.75em;
-webkit-padding-end: 0.75em;
-webkit-padding-after: 0.625em;
border: 2px groove (internal value); }

figcaptionfigure caption NEW # T

The figcaption element represents a caption or legend for a figure.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A figcaption element must have both a start tag and an end tag.

Permitted parent elements #

figure

DOM interface #

Uses HTMLElement.

figurefigure with optional caption NEW # T

The figure element represents a unit of content, optionally with a caption, that is self-contained, that is typically referenced as a single unit from the main flow of the document, and that can be moved away from the main flow of the document without affecting the document’s meaning.

Permitted contents #

one figcaption element, followed by flow content or flow content followed by an optional figcaption element

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A figure element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

Uses HTMLElement.

formuser-submittable form # T

The form element represents a user-submittable form.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
action = URL potentially surrounded by spaces #
The submission action for the form.
method = "get" or "post" #
The HTTP method with which a UA is meant to associate this element for form submission.
enctype = "application/x-www-form-urlencoded" or "multipart/form-data" or "text/plain" #
A MIME type with which a UA is meant to associate the form contents for form submission.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
accept-charset = list of character-encoding names #
Specifies the character encodings used for form submission.
novalidate = "novalidate" or "" (empty string) or empty NEW #
Specifies that the element represents a form that is not meant to be validated during form submission.
target = browsing-context name or keyword #
A browsing context or keyword that represents the target of the form.
Any string that is either of the following:
autocomplete = "on" or "off" NEW #
Specifies whether the element represents a form for which by default a UA is meant to store the values entered into its input elements by the user (so that the UA can pre-fill the form later).

Additional constraints and admonitions #

  • The form element must not contain any nested form elements.

Tag omission #

A form element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

[OverrideBuiltins]
interface HTMLFormElement : HTMLElement {
           attribute DOMString acceptCharset;
           attribute DOMString action;
           attribute DOMString autocomplete;
           attribute DOMString enctype;
           attribute DOMString encoding;
           attribute DOMString method;
           attribute DOMString name;
           attribute boolean noValidate;
           attribute DOMString target;

  readonly attribute HTMLFormControlsCollection elements;
  readonly attribute long length;
  caller getter any (in unsigned long index);
  caller getter any (in DOMString name);

  void submit();
  void reset();
  boolean checkValidity();

  void dispatchFormInput();
  void dispatchFormChange();
};

Typical default display properties #

form {
display: block;
margin-top: 0em; }

h1heading # T

The h1 through h6 elements are headings for the sections with which they are associated.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The h1 element must not appear as a descendant of the address element.
  • The align attribute on the h1 element is obsolete. Use CSS instead.

Tag omission #

An h1 element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements, hgroup

DOM interface #

interface HTMLHeadingElement : HTMLElement {};

Typical default display properties #

h1 {
display: block;
font-size: 2em;
margin: .67em 0 .67em 0;
font-weight: bold; }

h2heading # T

The h1 through h6 elements are headings for the sections with which they are associated.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The h2 element must not appear as a descendant of the address element.
  • The align attribute on the h2 element is obsolete. Use CSS instead.

Tag omission #

An h2 element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements, hgroup

DOM interface #

interface HTMLHeadingElement : HTMLElement {};

Typical default display properties #

h2 {
display: block;
font-size: 1.5em;
margin: .83em 0 .83em 0;
font-weight: bold; }

h3heading # T

The h1 through h6 elements are headings for the sections with which they are associated.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The h3 element must not appear as a descendant of the address element.
  • The align attribute on the h3 element is obsolete. Use CSS instead.

Tag omission #

An h3 element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements, hgroup

DOM interface #

interface HTMLHeadingElement : HTMLElement {};

Typical default display properties #

h3 {
display: block;
font-size: 1.17em;
margin: 1em 0 1em 0;
font-weight: bold; }

h4heading # T

The h1 through h6 elements are headings for the sections with which they are associated.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The h4 element must not appear as a descendant of the address element.
  • The align attribute on the h4 element is obsolete. Use CSS instead.

Tag omission #

An h4 element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements, hgroup

DOM interface #

interface HTMLHeadingElement : HTMLElement {};

Typical default display properties #

h4 {
display: block;
margin: 1.33em 0 1.33em 0;
font-weight: bold; }

h5heading # T

The h1 through h6 elements are headings for the sections with which they are associated.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The h5 element must not appear as a descendant of the address element.
  • The align attribute on the h5 element is obsolete. Use CSS instead.

Tag omission #

An h5 element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements, hgroup

DOM interface #

interface HTMLHeadingElement : HTMLElement {};

Typical default display properties #

h5 {
display: block;
font-size: .83em;
margin: 1.67em 0 1.67em 0;
font-weight: bold; }

h6heading # T

The h1 through h6 elements are headings for the sections with which they are associated.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The h6 element must not appear as a descendant of the address element.
  • The align attribute on the h6 element is obsolete. Use CSS instead.

Tag omission #

An h6 element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements, hgroup

DOM interface #

interface HTMLHeadingElement : HTMLElement {};

Typical default display properties #

h6 {
display: block;
font-size: .67em;
margin: 2.33em 0 2.33em 0;
font-weight: bold; }

hgroupheading group NEW # T

The hgroup element represents a group of headings.

Permitted contents #

one or more of: one h1 element, or one h2 element, or one h3 element, or one h4 element, or one h5 element, or one h6 element

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A hgroup element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

Details #

The hgroup element is typically used to group a set of one or more h1-h6 elements — to group, for example, a section title and an accompanying subtitle.

DOM interface #

Uses HTMLElement.

Typical default display properties #

hgroup {
display: block; }

hrthematic break CHANGED # T

The hr element represents a paragraph-level thematic break.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

The hr element is a void element. An hr element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain flow elements

Changes in HTML5 #

Although previous versions of HTML defined the hr element only in presentational terms, the element has now been given the specific semantic purpose of representing a “paragraph-level thematic break”.

Details #

Some examples of thematic breaks that can be marked up using the hr element include a scene change in a story, or a transition to another topic within a section of a reference book.

DOM interface #

interface HTMLHRElement : HTMLElement {};

Typical default display properties #

hr {
display: block;
margin: 0.5em auto;
border-style: inset;
border-width: 1px; }

htmlroot element # T

The html element represents the root of a document.

Permitted contents #

one head element, followed by one body element

Permitted attributes #

global attributes
Any attributes permitted globally.
manifest = Non-empty URL potentially surrounded by spaces NEW #
The address of the document’s application cache manifest (which controls caching of content for offline use).

Additional constraints and admonitions #

  • The version attribute on the html element is obsolete. You can safely omit it.

Tag omission #

An html element’s start tag may be omitted if the first thing inside the html element is not a comment.

An html element’s end tag may be omitted if the html element is not immediately followed by a comment and the element contains a body element that is either not empty or whose start tag has not been omitted.

DOM interface #

interface HTMLHtmlElement : HTMLElement {};

Typical default display properties #

html {
display: block; }
html:focus {
outline: none; }

ioffset text conventionally styled in italic CHANGED # T

The i element represents a span of text offset from its surrounding content without conveying any extra emphasis or importance, and for which the conventional typographic presentation is italic text; for example, a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, or a ship name.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

An i element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Changes in HTML5 #

Although previous versions of HTML defined the i element only in presentational terms, the element has now been given the specific semantic purpose of representing text “offset from its surrounding content without conveying any extra emphasis or importance, and for which the conventional typographic presentation is italic text”.

DOM interface #

Uses HTMLElement.

Typical default display properties #

i {
font-style: italic; }

iframenested browsing context (inline frame) # T

The iframe element introduces a new nested browsing context.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
src = Non-empty URL potentially surrounded by spaces #
The address of a page that the nested browsing context is to contain.
name = browsing-context name #
A valid browsing context name.
Any string, with the following restrictions:
  • must not start with a "_" character
  • must be at least one character long
width = non-negative integer #
The width of the iframe, in CSS pixels.
height = non-negative integer #
The height of the iframe, in CSS pixels.
sandbox = sandbox “allow” keywords list NEW #
Instructs the UA to “sandbox” the iframe by disallowing/disabling various features, and then (optionally) re-allowing/re-enabling particular features.
The presence of this attribute—even if no value is given (that is, the attribute is specified using empty attribute syntax) or even if the value consists only of space characters—instructs the UA to enforce all the following default sandbox restrictions:
  • plugins are disallowed/disabled within the iframe
  • forms are disallowed/disabled within the iframe
  • scripts are disallowed/disabled within the iframe
  • links to other browsing contexts are disallowed/disabled within the iframe
  • same-origin treatment of the content hosted by the iframe and the content which hosts the iframe is disallowed/disabled; the iframe is instead treated as being from a unique origin
If any sandbox “allow” keywords are given, they instruct the UA to override particular default sandbox restrictions by re-allowing/re-enabling certain features, as follows:
  • allow-forms: re-enables forms
  • allow-scripts: re-enables scripts
  • allow-top-navigation: re-enables links within the content of the iframe to navigate to its top-level browsing context
  • allow-same-origin: re-enables same-origin treatment of the content hosted by the iframe and the content which hosts the iframe (instead of forcing the iframe into a unique origin)
seamless = "seamless" or "" (empty string) or empty NEW #
Instructs the UA that the iframe element’s browsing context is to be rendered in a manner that makes it appear to be part of the containing document (seamlessly included in the parent document).

Additional constraints and admonitions #

  • The interactive element iframe must not appear as a descendant of the a element.
  • The interactive element iframe must not appear as a descendant of the button element.
  • The longdesc attribute on the iframe element is obsolete. Use a regular a element to link to the description.
  • The align attribute on the iframe element is obsolete. Use CSS instead.
  • The allowtransparency attribute on the iframe element is obsolete. Use CSS instead.
  • The frameborder attribute on the iframe element is obsolete. Use CSS instead.
  • The marginheight attribute on the iframe element is obsolete. Use CSS instead.
  • The marginwidth attribute on the iframe element is obsolete. Use CSS instead.
  • The scrolling attribute on the iframe element is obsolete. Use CSS instead.

Tag omission #

An iframe element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLIFrameElement : HTMLElement {
           attribute DOMString src;
           attribute DOMString srcdoc;
           attribute DOMString name;
  [PutForwards=value] readonly attribute DOMSettableTokenList sandbox;
           attribute boolean seamless;
           attribute DOMString width;
           attribute DOMString height;
  readonly attribute Document contentDocument;
  readonly attribute WindowProxy contentWindow;
};

Typical default display properties #

iframe {
border: 2px inset; }

imgimage # T

The img element represents an image.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
src = Non-empty URL potentially surrounded by spaces #
A URL referencing a non-interactive, optionally animated, image that is neither paged nor scripted.
alt = normal character data #
The fallback content for the image.
height = non-negative integer #
The height of the image, in CSS pixels.
width = non-negative integer #
The width of the image, in CSS pixels.
usemap = hash-name reference #
A hash-name reference to a map element with which to associate the image.
ismap = "ismap" or "" (empty string) or empty #
Specifies that its img element provides access to a server-side image map.
border = zero OBSOLETE #
Specifies that its img element represents a borderless image.
The border attribute on the img element is obsolete. Consider specifying “img { border: 0; }“ in CSS instead.
The literal string "0".

Additional constraints and admonitions #

  • The element img with the attribute usemap must not appear as a descendant of the a element.
  • The element img with the attribute usemap must not appear as a descendant of the button element.
  • The img element with the ismap attribute set must have an ancestor a element with the href attribute.
  • The longdesc attribute on the img element is obsolete. Use a regular a element to link to the description.
  • The name attribute on the img element is obsolete. Use the id attribute instead.
  • The align attribute on the img element is obsolete. Use CSS instead.
  • The hspace attribute on the img element is obsolete. Use CSS instead.
  • The vspace attribute on the img element is obsolete. Use CSS instead.
  • The border attribute on the img element is obsolete. Use CSS instead.

Tag omission #

The img element is a void element. An img element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

[NamedConstructor=Image(),
 NamedConstructor=Image(in unsigned long width),
 NamedConstructor=Image(in unsigned long width, in unsigned long height)]
interface HTMLImageElement : HTMLElement {
           attribute DOMString alt;
           attribute DOMString src;
           attribute DOMString useMap;
           attribute boolean isMap;
           attribute unsigned long width;
           attribute unsigned long height;
  readonly attribute unsigned long naturalWidth;
  readonly attribute unsigned long naturalHeight;
  readonly attribute boolean complete;
};

inputinput control CHANGED # T

The input element is a multipurpose element for representing input controls.

An input element with no type attribute specified represents the same thing as an input element with its type attribute set to "text".

Changes in HTML5 #

Several new input element types have been added, and several new attributes are now allowed on the element.

input type=texttext-input field # T

The input element with a type attribute whose value is "text" represents a one-line plain text edit control for the input element’s value.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "text" #
Specifies that its input element is a one-line plain-text edit control for the input element’s value.
maxlength = positive integer #
The maximum allowed value length of the element.
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
size = positive integer #
The number of options meant to be shown by the control represented by its element.
value = string #
Specifies a value for this input element.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
pattern = pattern NEW #
Specifies a regular expression against which a UA is meant to check the value of the control represented by its element.
A regular expression that must match the JavaScript Pattern production as specified in [ECMA 262].
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
placeholder = string NEW #
A short hint (one word or a short phrase) intended to aid the user when entering data into the control represented by its element.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=passwordpassword-input field # T

The input element with a type attribute whose value is "password" represents a one-line plain-text edit control for entering a password.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "password" #
Specifies that its input element is a one-line plain-text edit control for entering a password.
maxlength = positive integer #
The maximum allowed value length of the element.
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
size = positive integer #
The number of options meant to be shown by the control represented by its element.
value = string #
Specifies a value for this input element.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
pattern = pattern NEW #
Specifies a regular expression against which a UA is meant to check the value of the control represented by its element.
A regular expression that must match the JavaScript Pattern production as specified in [ECMA 262].
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
placeholder = string NEW #
A short hint (one word or a short phrase) intended to aid the user when entering data into the control represented by its element.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=checkboxcheckbox # T

The input element with a type attribute whose value is "checkbox" represents a state or option that can be toggled.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "checkbox" #
Specifies that its input element represents a state or option that can be toggled.
checked = "checked" or "" (empty string) or empty #
Specifies that the element represents a selected control.
value = string #
Specifies a value for the input element.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=radioradio button # T

The input element with a type attribute whose value is "radio" represents a selection of one item from a list of items (a radio button).

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "radio" #
Specifies that its input element represents a selection of one item from a list of items.
checked = "checked" or "" (empty string) or empty #
Specifies that the element represents a selected control.
value = string #
Specifies a value for the input element.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=buttonbutton # T

The input element with a type attribute whose value is "button" represents a button with no additional semantics.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "button" #
Specifies that its input element is a button with no additional semantics.
value = string #
Specifies a value for the input element.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=submitsubmit button # T

The input element with a type attribute whose value is "submit" represents a button for submitting a form.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "submit" #
Specifies that its input element is a button for submitting a form.
value = string #
Specifies a value for the input element.
formaction = URL potentially surrounded by spaces NEW #
The form-submission action for the element.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
formenctype = "application/x-www-form-urlencoded" or "multipart/form-data" or "text/plain" NEW #
A MIME type with which a UA is meant to associate this element for form submission.
formmethod = "get" or "post" NEW #
The HTTP method with which a UA is meant to associate this element for form submission.
formtarget = browsing-context name or keyword NEW #
A browsing context name or keyword that represents the target of the control.
Any string that is either of the following:
formnovalidate = "formnovalidate" or "" (empty string) or empty NEW #
Specifies that the element represents a control whose value is not meant to be validated during form submission.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=resetreset button # T

The input element with a type attribute whose value is "reset" represents a button for resetting a form.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "reset" #
Specifies that its input element is a button for resetting a form.
value = string #
Specifies a value for the input element.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=filefile upload control # T

The input element with a type attribute whose value is "file" represents a list of file items, each consisting of a file name, a file type, and a file body (the contents of the file).

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "file" #
Specifies that its input element represents a list of file items.
accept = list of MIME types #
Provides the UA with a hint of what file types the server is able to accept.
A set of comma-separated strings, each of which is a valid MIME type, with no parameters.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
multiple = "multiple" or "" (empty string) or empty NEW #
Specifies that the element allows multiple values.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=hiddenhidden input control # T

The input element with a type attribute whose value is "hidden" represents a value that is not intended to be examined or manipulated by the user.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "hidden" #
Specifies that its input element represents a value that is not intended to be examined or manipulated by the user.
value = string #
Specifies a value for the input element.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=imageimage-coordinates input control # T

The input element with a type attribute whose value is "image" represents either an image from which the UA enables a user to interactively select a pair of coordinates and submit the form, or alternatively a button from which the user can submit the form.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "image" #
Specifies that its input element represents either an image from which the UA enables a user to interactively select a pair of coordinates and submit the form, or alternatively a button from which the user can submit the form.
alt = string #
Provides a textual label for an alternative button for users and UAs who cannot use the image specified by the src attribute.
src = Non-empty URL potentially surrounded by spaces #
Specifies the location of an image.
formaction = URL potentially surrounded by spaces NEW #
The form-submission action for the element.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
formenctype = "application/x-www-form-urlencoded" or "multipart/form-data" or "text/plain" NEW #
A MIME type with which a UA is meant to associate this element for form submission.
formmethod = "get" or "post" NEW #
The HTTP method with which a UA is meant to associate this element for form submission.
formtarget = browsing-context name or keyword NEW #
A browsing context name or keyword that represents the target of the control.
Any string that is either of the following:
formnovalidate = "formnovalidate" or "" (empty string) or empty NEW #
Specifies that the element represents a control whose value is not meant to be validated during form submission.
height = non-negative integer #
The height of the image, in CSS pixels.
width = non-negative integer #
The width of the image, in CSS pixels.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=datetimeglobal date-and-time input control NEW # T

The input element with a type attribute whose value is "datetime" represents a control for setting the element’s value to a string representing a global date and time (with timezone information).

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "datetime" #
Specifies that its input element is a control for setting the element’s value to a string representing a global date and time.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
min = date and time NEW #
The expected lower bound for the element’s value.
A valid date-time as defined in [RFC 3339], with these additional qualifications:
  • the literal letters T and Z in the date/time syntax must always be uppercase
  • the date-fullyear production is instead 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
max = date and time NEW #
The expected upper bound for the element’s value.
A valid date-time as defined in [RFC 3339], with these additional qualifications:
  • the literal letters T and Z in the date/time syntax must always be uppercase
  • the date-fullyear production is instead 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
step = "any" or positive floating-point number NEW #
Specifies the value granularity of the element’s value.
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
value = date and time #
A string representing a global date and time.
A valid date-time as defined in [RFC 3339], with these additional qualifications:
  • the literal letters T and Z in the date/time syntax must always be uppercase
  • the date-fullyear production is instead 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

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=datetime-locallocal date-and-time input control NEW # T

The input element with a type attribute whose value is "datetime-local" represents a control for setting the element’s value to a string representing a local date and time (with no timezone information).

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "datetime-local" #
Specifies that its input element is a control for setting the element’s value to a string representing a local date and time.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
min = local date and time NEW #
The expected lower bound for the element’s value.
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
max = local date and time NEW #
The expected upper bound for the element’s value.
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
step = "any" or positive floating-point number NEW #
Specifies the value granularity of the element’s value.
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
value = local date and time #
A string representing a local date and time.
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

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=datedate input control NEW # T

The input element with a type attribute whose value is "date" represents a control for setting the element’s value to a string representing a date.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "date" #
Specifies that its input element is a control for setting the element’s value to a string representing a date.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
min = date NEW #
The expected lower bound for the element’s value.
A valid full-date as defined in [RFC 3339], with the additional qualification that the year component is four or more digits representing a number greater than 0.

Example:

1996-12-19
max = date NEW #
The expected upper bound for the element’s value.
A valid full-date as defined in [RFC 3339], with the additional qualification that the year component is four or more digits representing a number greater than 0.

Example:

1996-12-19
step = "any" or positive integer NEW #
Specifies the value granularity of the element’s value.
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
value = date #
A string representing a date.
A valid full-date as defined in [RFC 3339], with the additional qualification that the year component is four or more digits representing a number greater than 0.

Example:

1996-12-19

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=monthyear-and-month input control NEW # T

The input element with a type attribute whose value is "month" represents a control for setting the element’s value to a string representing a month.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "month" #
Specifies that its input element is a control for setting the element’s value to a string representing a month.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
min = month NEW #
The expected lower bound for the element’s value.
The following parts, in exactly the following order:
  1. Four or more digits representing a number greater than 0.
  2. The literal string "-".
  3. Two digits, representing the month month, in the range 1 ≤ month, ≤ 12.

Example:

1996-12
max = month NEW #
The expected upper bound for the element’s value.
The following parts, in exactly the following order:
  1. Four or more digits representing a number greater than 0.
  2. The literal string "-".
  3. Two digits, representing the month month, in the range 1 ≤ month, ≤ 12.

Example:

1996-12
step = "any" or positive integer NEW #
Specifies the value granularity of the element’s value.
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
value = month #
A string representing a month.
The following parts, in exactly the following order:
  1. Four or more digits representing a number greater than 0.
  2. The literal string "-".
  3. Two digits, representing the month month, in the range 1 ≤ month, ≤ 12.

Example:

1996-12

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=timetime input control NEW # T

The input element with a type attribute whose value is "time" represents a control for setting the element’s value to a string representing a time (with no timezone information).

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "time" #
Specifies that its input element is a control for setting the element’s value to a string representing a time.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
min = time NEW #
The expected lower bound for the element’s value.
A valid partial-time as defined in [RFC 3339].

Examples:

23:20:50.52
17:39:57
max = time NEW #
The expected upper bound for the element’s value.
A valid partial-time as defined in [RFC 3339].

Examples:

23:20:50.52
17:39:57
step = "any" or positive floating-point number NEW #
Specifies the value granularity of the element’s value.
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
value = time #
A string representing a time (with no timezone information).
A valid partial-time as defined in [RFC 3339].

Examples:

23:20:50.52
17:39:57

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=weekyear-and-week input control NEW # T

The input element with a type attribute whose value is "week" represents a control for setting the element’s value to a string representing a week.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "week" #
Specifies that its input element is a control for setting the element’s value to a string representing a week.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
min = week NEW #
The expected lower bound for the element’s value.
The following parts, in exactly the following order:
  1. Four or more digits representing year year, where year > 0.
  2. The literal string "-W".
  3. Two digits, representing the week week, in the range 1 ≤ weekmaxweek, where maxweek is either 52 or 53, depending on the particular year.

Example:

1996-W16
max = week NEW #
The expected upper bound for the element’s value.
The following parts, in exactly the following order:
  1. Four or more digits representing year year, where year > 0.
  2. The literal string "-W".
  3. Two digits, representing the week week, in the range 1 ≤ weekmaxweek, where maxweek is either 52 or 53, depending on the particular year.

Example:

1996-W16
step = "any" or positive integer NEW #
Specifies the value granularity of the element’s value.
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
value = week #
A string representing a week.
The following parts, in exactly the following order:
  1. Four or more digits representing year year, where year > 0.
  2. The literal string "-W".
  3. Two digits, representing the week week, in the range 1 ≤ weekmaxweek, where maxweek is either 52 or 53, depending on the particular year.

Example:

1996-W16

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=numbernumber input control NEW # T

The input element with a type attribute whose value is "number" represents a precise control for setting the element’s value to a string representing a number.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "number" #
Specifies that its input element is a precise control for setting the element’s value to a string representing a number.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
min = floating-point number NEW #
The expected lower bound for the element’s value.
max = floating-point number NEW #
The expected upper bound for the element’s value.
step = "any" or positive floating-point number NEW #
Specifies the value granularity of the element’s value.
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
value = floating-point number #
A string representing a number.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=rangeimprecise number-input control NEW # T

The input element with a type attribute whose value is "range" represents an imprecise control for setting the element’s value to a string representing a number.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "range" #
Specifies that its input element is an imprecise control for setting the element’s value to a string representing a number.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
min = floating-point number NEW #
The expected lower bound for the element’s value.
max = floating-point number NEW #
The expected upper bound for the element’s value.
step = "any" or positive floating-point number NEW #
Specifies the value granularity of the element’s value.
value = floating-point number #
A string representing a number.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=emaile-mail address input control NEW # T

The input element with a type attribute whose value is "email" represents a control for editing a list of e-mail addresses given in the element’s value.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes & name & disabled & form & type & autocomplete & autofocus & list & maxlength & pattern & readonly & required & size & placeholder & multiple & value (multiple addresses) or value (single address)

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "email" #
Specifies that its input element is a control for editing an e-mail address or list of e-mail addresses given in the element’s value.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
maxlength = positive integer #
The maximum allowed value length of the element.
pattern = pattern NEW #
Specifies a regular expression against which a UA is meant to check the value of the control represented by its element.
A regular expression that must match the JavaScript Pattern production as specified in [ECMA 262].
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
size = positive integer #
The number of options meant to be shown by the control represented by its element.
placeholder = string NEW #
A short hint (one word or a short phrase) intended to aid the user when entering data into the control represented by its element.
multiple = "multiple" or "" (empty string) or empty NEW #
Specifies that the element allows multiple values.
value = list of e-mail addresses #
A list of e-mail addresses.
A set of comma-separated strings, each of which is a valid email address.
value = e-mail address #
A single e-mail address.
Any string that matches the following [ABNF] production:
1*( atext / "." ) "@" ldh-str 1*( "." ldh-str )

…where atext is as defined in [RFC 5322], and ldh-str is as defined in [RFC 1034].

Examples:

foo-bar.baz@example.com

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=urlURL input control NEW # T

The input element with a type attribute whose value is "url" represents a control for editing an absolute URL given in the element’s value.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "url" #
Specifies that its input element is a control for editing an absolute URL given in the element’s value.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
maxlength = positive integer #
The maximum allowed value length of the element.
pattern = pattern NEW #
Specifies a regular expression against which a UA is meant to check the value of the control represented by its element.
A regular expression that must match the JavaScript Pattern production as specified in [ECMA 262].
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
size = positive integer #
The number of options meant to be shown by the control represented by its element.
placeholder = string NEW #
A short hint (one word or a short phrase) intended to aid the user when entering data into the control represented by its element.
value = "" or absolute URL potentially surrounded by spaces #
An absolute URL.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=searchsearch field NEW # T

The input element with a type attribute whose value is "search" represents a one-line plain-text edit control for entering one or more search terms.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "search" #
Specifies that its input element is a one-line plain-text edit control for entering one or more search terms.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
maxlength = positive integer #
The maximum allowed value length of the element.
pattern = pattern NEW #
Specifies a regular expression against which a UA is meant to check the value of the control represented by its element.
A regular expression that must match the JavaScript Pattern production as specified in [ECMA 262].
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
size = positive integer #
The number of options meant to be shown by the control represented by its element.
placeholder = string NEW #
A short hint (one word or a short phrase) intended to aid the user when entering data into the control represented by its element.
value = string #
Specifies a value for this input element.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=teltelephone-number-input field NEW # T

The input element with a type attribute whose value is "tel" represents a one-line plain-text edit control for entering a telephone number.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "tel" #
Specifies that its input element is a one-line plain-text edit control for entering a telephone number.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
maxlength = positive integer #
The maximum allowed value length of the element.
pattern = pattern NEW #
Specifies a regular expression against which a UA is meant to check the value of the control represented by its element.
A regular expression that must match the JavaScript Pattern production as specified in [ECMA 262].
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
size = positive integer #
The number of options meant to be shown by the control represented by its element.
placeholder = string NEW #
A short hint (one word or a short phrase) intended to aid the user when entering data into the control represented by its element.
value = string #
Specifies a value for this input element.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

input type=colorcolor-well control NEW # T

The input element with a type attribute whose value is "color" represents a color-well control, for setting the element’s value to a string representing a simple color.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
type = "color" #
Specifies that its input element is a color-well control, for setting the element’s value to a string representing a simple color.
autocomplete = "on" or "off" NEW #
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later).
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
list = ID reference NEW #
The value of the id attribute on the datalist with which to associate the element.
value = simple color #
An string representing a 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.

Color keywords (for example, strings such as “red” or “green”) are not allowed.

Additional constraints and admonitions #

  • The interactive element input must not appear as a descendant of the a element.
  • The interactive element input must not appear as a descendant of the button element.
  • Any input element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The list attribute of the input element must refer to a datalist element.
  • Element input with attribute type whose value is “button” must have non-empty attribute value.
  • The usemap attribute on the input element is obsolete. Use the img element instead of the input element for image maps.
  • The align attribute on the input element is obsolete. Use CSS instead.

Tag omission #

The input element is a void element. An input element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLInputElement : HTMLElement {
           attribute DOMString accept;
           attribute DOMString alt;
           attribute DOMString autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute DOMString dirName;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute FileList files;
           attribute DOMString formAction;
           attribute DOMString formEnctype;
           attribute DOMString formMethod;
           attribute boolean formNoValidate;
           attribute DOMString formTarget;
           attribute DOMString height;
           attribute boolean indeterminate;
  readonly attribute HTMLElement list;
           attribute DOMString max;
           attribute long maxLength;
           attribute DOMString min;
           attribute boolean multiple;
           attribute DOMString name;
           attribute DOMString pattern;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long size;
           attribute DOMString src;
           attribute DOMString step;
           attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
           attribute Date valueAsDate;
           attribute double valueAsNumber;
  readonly attribute HTMLOptionElement selectedOption;
           attribute DOMString width;

  void stepUp(in optional long n);
  void stepDown(in optional long n);

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

insinserted text # T

The ins element represents a range of text that has been inserted (added) to a document.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
cite = URL potentially surrounded by spaces #
The address of a document that explains why the text was added.
datetime = date and time or date #
The date and time when the text was added.
A valid date-time as defined in [RFC 3339], with these additional qualifications:
  • the literal letters T and Z in the date/time syntax must always be uppercase
  • the date-fullyear production is instead 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
A valid full-date as defined in [RFC 3339], with the additional qualification that the year component is four or more digits representing a number greater than 0.

Example:

1996-12-19

Tag omission #

An ins element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements, any element that can contain flow elements

DOM interface #

interface HTMLModElement : HTMLElement {
           attribute DOMString cite;
           attribute DOMString dateTime;
};

Typical default display properties #

ins {
text-decoration: underline; }

kbduser input # T

The kbd element represents user input.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A kbd element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Details #

The kbd element typically represents keyboard input, though it may also represent other input, such as voice commands.

DOM interface #

Uses HTMLElement.

Typical default display properties #

kbd {
font-family: monospace; }

keygenkey-pair generator/input control NEW # T

The keygen element represents a control for generating a public-private key pair and for submitting the public key from that key pair.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
challenge = string #
A challenge string that is submitted along with the public key.
keytype = "rsa" #
The type of key generated.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.

Additional constraints and admonitions #

  • The interactive element keygen must not appear as a descendant of the a element.
  • The interactive element keygen must not appear as a descendant of the button element.
  • Any keygen element descendant of a label element with a for attribute must have an ID value that matches that for attribute.

Tag omission #

The keygen element is a void element. A keygen element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLKeygenElement : HTMLElement {
           attribute boolean autofocus;
           attribute DOMString challenge;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
           attribute DOMString keytype;
           attribute DOMString name;

  readonly attribute DOMString type;

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;
};

labelcaption for a form control # T

The label element represents a caption for a form control.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
for = ID reference #
The value of the id attribute on a form control for which the label is a caption.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.

Additional constraints and admonitions #

  • The label element must not contain any nested label elements.
  • The label element may contain at most one descendant input element, button element, select element, or textarea element.
  • The for attribute of the label element must refer to a form control.
  • The interactive element label must not appear as a descendant of the a element.
  • The interactive element label must not appear as a descendant of the button element.

Tag omission #

A label element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLLabelElement : HTMLElement {
  readonly attribute HTMLFormElement form;
           attribute DOMString htmlFor;
  readonly attribute HTMLElement control;
};

Typical default display properties #

label {
cursor: default; }

legendtitle or explanatory caption # T

The legend element represents a title or explanatory caption for the rest of the contents of the legend element’s parent element.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A legend element must have both a start tag and an end tag.

Permitted parent elements #

fieldset

DOM interface #

interface HTMLLegendElement : HTMLElement {
  readonly attribute HTMLFormElement form;
};

Typical default display properties #

legend {
display: block;
padding-start: 2px;
-webkit-padding-end: 2px;
border: none; }

lilist item # T

The li element represents a list item.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
value = integer CHANGED #
The ordinal value of the list item. Permitted only if the li element is a child of an ol element.
The value attribute on the li element was deprecated in a previous version of HTML, but is no longer deprecated, as it has meaning and is not simply presentational.

Additional constraints and admonitions #

Tag omission #

An li element must have a start tag.

An li element’s end tag may be omitted if the li element is immediately followed by another li element or if there is no more content in the parent element.

Permitted parent elements #

ul, ol, menu

DOM interface #

interface HTMLLIElement : HTMLElement {
           attribute long value;
};

Typical default display properties #

li {
display: list-item; }

mapimage-map definition # T

The map element, in conjunction with any area element descendants, defines an image map.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
name = name #
A name by which the map can be referenced.
Any string, with the following restrictions:

Additional constraints and admonitions #

  • The id attribute on a map element must have the same value as the name attribute.

Tag omission #

A map element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements, any element that can contain flow elements

DOM interface #

interface HTMLMapElement : HTMLElement {
           attribute DOMString name;
  readonly attribute HTMLCollection areas;
  readonly attribute HTMLCollection images;
};

Typical default display properties #

map {
display: inline; }

markmarked (highlighted) text NEW # T

The mark element represents a run of text in one document marked or highlighted for reference purposes, due to its relevance in another context.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A mark element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

mark {
background-color: yellow;
color: black; }

metametadata CHANGED # T

The meta element is a multipurpose element for representing metadata.

The details of the meta element are described in the following sections:

Additional constraints and admonitions #

  • The scheme attribute on the meta element is obsolete. Use only one scheme per field, or make the scheme declaration part of the value.

Changes in HTML5 #

Although previous versions of HTML allowed the http-equiv attribute on the meta element to have any number of possible values, the http-equiv attribute is now restricted to only the specific values described in this reference. Also, the new charset attribute is now allowed.

meta namename-value metadata # T

The meta element with a name attribute represents document metadata in the form of name/value pairs.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
Specifies the name part of a name/value pair.
content = string #
Specifies the value part of a name/value pair.

Additional constraints and admonitions #

  • The name attribute on the meta element must be either a defined metadata name or a registered metadata name.
  • A defined metadata name is any of the following:
    application-name
    When the name attribute is set to "application-name", the value of the content attribute must be a string representing the name of the Web application that the page represents.
    author
    When the name attribute is set to "author", the value of the content attribute must be a string that gives the name of one of the authors of the document.
    description
    When the name attribute is set to "description", the value of the content attribute must be a string that describes the page.
    generator
    When the name attribute is set to "generator", the value of the content attribute must be a string that identifies the software used to generate the document.
    keywords
    When the name attribute is set to "keywords", the value of the content attribute must be a set of comma-separated strings, each of which is a keyword relevant to the document.
  • A registered metadata name is any metadata name registered in the central MetaExtensions registration page.

Tag omission #

The meta element is a void element. A meta element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain metadata elements

DOM interface #

interface HTMLMetaElement : HTMLElement {
           attribute DOMString name;
           attribute DOMString httpEquiv;
           attribute DOMString content;
};

meta http-equiv=refresh“refresh” pragma directive # T

The meta element with a http-equiv attribute whose value is "refresh" represents a pragma directive that specifies either a number of seconds after which to reload the current page, or a number of seconds after which to load a different page in place of the current page, and the URL for the replacement page.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes & http-equiv="refresh" & content

global attributes
Any attributes permitted globally.
http-equiv = "refresh" #
Indicates that the meta element is a pragma directive that specifies either a number of seconds after which to reload the current page, or a number of seconds after which to load a different page in place of the current page, and the URL for the replacement page.
content = refresh value #
Specifies one of the following:
  • the number of seconds after which to reload the current page
  • the number of seconds after which to load a different page in place of the current page, and the URL for the replacement page
Any one of the following:

Tag omission #

The meta element is a void element. A meta element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain metadata elements, noscript

DOM interface #

interface HTMLMetaElement : HTMLElement {
           attribute DOMString name;
           attribute DOMString httpEquiv;
           attribute DOMString content;
};

meta http-equiv=default-style“preferred stylesheet” pragma directive # T

The meta element with a http-equiv attribute whose value is "default-style" represents a pragma directive that specifies the document’s preferred stylesheet.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes & http-equiv="default-style" & content

global attributes
Any attributes permitted globally.
http-equiv = "default-style" #
Indicates that the meta element is a pragma directive that specifies the document’s preferred stylesheet.
content = default-style name #
Specifies the name of the document’s preferred stylesheet. The name must meet either of the following sets of constraints:
  • The name must match the value of the title attribute on a link element in the same document, and that link element must have an href attribute that references the location of a CSS stylesheet.
  • The name must match the value of the title attribute on a style element in the same document, and the contents of that element must be a CSS stylesheet.

Tag omission #

The meta element is a void element. A meta element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain metadata elements, noscript

DOM interface #

interface HTMLMetaElement : HTMLElement {
           attribute DOMString name;
           attribute DOMString httpEquiv;
           attribute DOMString content;
};

meta http-equiv=content-language“default language” pragma directive OBSOLETE # T

The meta element with a http-equiv attribute whose value is "content-language" represents a pragma directive that specifies a document-wide default language.

Using the meta element to specify the document-wide default language is obsolete. Consider specifying the language on the root element instead.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes & http-equiv="content-language" & content

global attributes
Any attributes permitted globally.
http-equiv = "content-language" #
Indicates that the meta element is a pragma directive that specifies a document-wide default language.
content = language tag #
Specifies a language to use as the document-wide default language.
A valid language tag as defined in [BCP 47].

Tag omission #

The meta element is a void element. A meta element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain metadata elements

DOM interface #

interface HTMLMetaElement : HTMLElement {
           attribute DOMString name;
           attribute DOMString httpEquiv;
           attribute DOMString content;
};

meta charsetdocument character-encoding declaration NEW # T

The meta element with a charset attribute represents a character encoding declaration.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
charset = character encoding name NEW #
Specifies a character encoding name.
For documents in the XML syntax, the value of the charset attribute must be a case-insensitive match for the string "UTF-8".
A case-insensitive match for any character set name for which the IANA [Character Sets] registry has a 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.

Tag omission #

The meta element is a void element. A meta element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain metadata elements

DOM interface #

interface HTMLMetaElement : HTMLElement {
           attribute DOMString name;
           attribute DOMString httpEquiv;
           attribute DOMString content;
};

meta http-equiv=content-typedocument character-encoding declaration # T

A meta element with a http-equiv attribute whose value is "content-type" and which has an accompanying content attribute and value represents a character encoding declaration.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes & http-equiv="content-type" & content

global attributes
Any attributes permitted globally.
http-equiv = "content-type" #
Indicates that the meta element is in the encoding declaration state and represents a character encoding declaration.
content = meta-charset string #
A specially formatted string providing a character encoding name.
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. One of the following:

Tag omission #

The meta element is a void element. A meta element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain metadata elements

Details #

A meta element with a http-equiv attribute whose value is "content-type" and which has an accompanying content attribute and value is said to be in the encoding declaration state.

DOM interface #

interface HTMLMetaElement : HTMLElement {
           attribute DOMString name;
           attribute DOMString httpEquiv;
           attribute DOMString content;
};

meterscalar gauge NEW # T

The meter element represents a scalar gauge providing a measurement within a known range, or a fractional value.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
value = floating-point number #
The “measured” value shown by meter.
min = floating-point number #
The lower bound of the range for the meter.
low = floating-point number #
The point that marks the upper boundary of the “low” segment of the meter.
high = floating-point number #
The point that marks the lower boundary of the “high” segment of the meter.
max = floating-point number #
The upper bound of the range for the meter.
optimum = floating-point number #
The point that marks the “optimum” position for the meter.

Additional constraints and admonitions #

  • The element meter must not appear as a descendant of the meter element.
  • The value of the min attribute must be less than or equal to the value of the value attribute.
  • The value of the value attribute must be greater than or equal to zero when the min attribute is absent.
  • The value of the value attribute must be less than or equal to the value of the max attribute.
  • The value of the value attribute must be less than or equal to one when the max attribute is absent.
  • The value of the min attribute must be less than or equal to the value of the max attribute.
  • The value of the max attribute must be greater than or equal to zero when the min attribute is absent.
  • The value of the min attribute must be less than or equal to one when the max attribute is absent.
  • The value of the min attribute must be less than or equal to the value of the low attribute.
  • The value of the low attribute must be greater than or equal to zero when the min attribute is absent.
  • The value of the min attribute must be less than or equal to the value of the high attribute.
  • The value of the high attribute must be greater than or equal to zero when the min attribute is absent.
  • The value of the low attribute must be less than or equal to the value of the high attribute.
  • The value of the high attribute must be less than or equal to the value of the max attribute.
  • The value of the high attribute must be less than or equal to one when the max attribute is absent.
  • The value of the low attribute must be less than or equal to the value of the max attribute.
  • The value of the low attribute must be less than or equal to one when the max attribute is absent.
  • The value of the min attribute must be less than or equal to the value of the optimum attribute.
  • The value of the optimum attribute must be greater than or equal to zero when the min attribute is absent.
  • The value of the optimum attribute must be less than or equal to the value of the max attribute.
  • The value of the optimum attribute must be less than or equal to one when the max attribute is absent.

Tag omission #

A meter element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLMeterElement : HTMLElement {
           attribute double value;
           attribute double min;
           attribute double max;
           attribute double low;
           attribute double high;
           attribute double optimum;
  readonly attribute HTMLFormElement form;
  readonly attribute NodeList labels;
};

Typical default display properties #

meter {
-webkit-block-flow: tb !important; }
meter {
display: inline-block;
height: 1em;
width: 5em;
vertical-align: -0.2em; }

noscriptfallback content for script # T

The noscript element is used to present different markup to user agents that don’t support scripting, by affecting how the document is parsed.

Permitted contents #

zero or more of: one link element, or one meta http-equiv=default-style element, or one meta http-equiv=refresh element, or one style element

or

transparent (either phrasing content or flow content)

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The noscript element must not be used in a document in the XML syntax.
  • The noscript element must not contain any nested noscript elements.

Tag omission #

A noscript element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain metadata elements, any element that can contain phrasing elements, any element that can contain flow elements

DOM interface #

Uses HTMLElement.

objectgeneric external content # T

The object element represents external content.

Permitted contents #

Transparent, with the following specific structure:

zero or more param elements, followed by flow content

or

zero or more param elements, followed by phrasing content

Permitted attributes #

global attributes
Any attributes permitted globally.
data = Non-empty URL potentially surrounded by spaces #
The address of the content.
type = MIME type #
The MIME type of the content.
A string that identifies a valid MIME media type as defined in [RFC 2046].
height = non-negative integer #
The height of the object, in CSS pixels.
width = non-negative integer #
The width of the object, in CSS pixels.
usemap = hash-name reference #
A hash-name reference to a map element with which to associate the object.
name = browsing-context name #
A valid browsing context name.
Any string, with the following restrictions:
  • must not start with a "_" character
  • must be at least one character long
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.

Additional constraints and admonitions #

  • The element object with the attribute usemap must not appear as a descendant of the a element.
  • The element object with the attribute usemap must not appear as a descendant of the button element.
  • The archive attribute on the object element is obsolete. Use the data attribute and type attribute to invoke plugins. To set a parameter with the name “archive”, use the param element.
  • The classid attribute on the object element is obsolete. Use the data attribute and type attribute to invoke plugins. To set a parameter with the name “classid”, use the param element.
  • The code attribute on the object element is obsolete. Use the data attribute and type attribute to invoke plugins. To set a parameter with the name “code”, use the param element.
  • The codebase attribute on the object element is obsolete. Use the data attribute and type attribute to invoke plugins. To set a parameter with the name “codebase”, use the param element.
  • The codetype attribute on the object element is obsolete. Use the data attribute and type attribute to invoke plugins. To set a parameter with the name “codetype”, use the param element.
  • The declare attribute on the object element is obsolete. Repeat the object element completely each time the resource is to be reused.
  • The standby attribute on the object element is obsolete. Optimize the linked resource so that it loads quickly or, at least, incrementally.
  • The align attribute on the object element is obsolete. Use CSS instead.
  • The hspace attribute on the object element is obsolete. Use CSS instead.
  • The vspace attribute on the object element is obsolete. Use CSS instead.
  • The border attribute on the object element is obsolete. Use CSS instead.

Tag omission #

An object element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements, any element that can contain flow elements

Details #

The object element represents external content, which, depending on the type of the content, will either be treated as an image, as a nested browsing context, or as external content to be processed by a plugin.

DOM interface #

interface HTMLObjectElement : HTMLElement {
           attribute DOMString data;
           attribute DOMString type;
           attribute DOMString name;
           attribute DOMString useMap;
  readonly attribute HTMLFormElement form;
           attribute DOMString width;
           attribute DOMString height;
  readonly attribute Document contentDocument;
  readonly attribute WindowProxy contentWindow;

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);
};

olordered list # T

The ol element represents a list (or sequence) of items; that is, a list in which the items are intentionally ordered, such that changing the order would change the meaning of the list.

Permitted contents #

zero or more li elements

Permitted attributes #

global attributes
Any attributes permitted globally.
start = integer CHANGED #
The ordinal value of the first list item.
The start attribute on the ol element was deprecated in a previous version of HTML, but is no longer deprecated, as it has meaning and is not simply presentational.
reversed = "reversed" or "" (empty string) or empty NEW #
If present, indicates that the list is a descending list (…, 3, 2, 1).
If not present, indicates that the list is an ascending list (1, 2, 3, …).
type = "1" or "a" or "A" or "i" or "I" CHANGED #
Indicates the marker type to use in the list, in the cases where the marker type of matters (for example, if items in the list are meant to be referenced by their number or letter).
The type attribute on the ol element was deprecated in a previous version of HTML, but is no longer deprecated, as it has meaning and is not simply presentational.

Additional constraints and admonitions #

Tag omission #

An ol element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

interface HTMLOListElement : HTMLElement {
           attribute boolean reversed;
           attribute long start;
           attribute DOMString type;
};

Typical default display properties #

ol {
display: block;
list-style-type: decimal;
-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
margin-start: 0;
-webkit-margin-end: 0;
padding-start: 40px; }

optgroupgroup of options # T

The optgroup element represents a group of option elements with a common label.

Permitted contents #

zero or more option elements

Permitted attributes #

global attributes
Any attributes permitted globally.
label = string #
Specifies the name of the group of options its optgroup element represents.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.

Tag omission #

An optgroup element must have a start tag.

An optgroup element’s end tag may be omitted if the optgroup element is immediately followed by another optgroup element, or if there is no more content in the parent element.

Permitted parent elements #

select

DOM interface #

interface HTMLOptGroupElement : HTMLElement {
           attribute boolean disabled;
           attribute DOMString label;
};

optionoption # T

The option element represents an option in a select control, or an option in a labelled set of options grouped together in an optgroup, or an option among the list of suggestions in a datalist.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
selected = "selected" or "" (empty string) or empty #
Specifies that this option is pre-selected.
label = string #
Specifies a label for the option.
value = string #
Specifies a value for the option.

Additional constraints and admonitions #

  • The name attribute on the option element is obsolete. Use the id attribute instead.

Tag omission #

An option element must have a start tag.

An option element’s end tag may be omitted if the option element is immediately followed by another option element, or if it is immediately followed by an optgroup element, or if there is no more content in the parent element.

Permitted parent elements #

optgroup, select, datalist

DOM interface #

[NamedConstructor=Option(),
 NamedConstructor=Option(in DOMString text),
 NamedConstructor=Option(in DOMString text, in DOMString value),
 NamedConstructor=Option(in DOMString text, in DOMString value, in boolean defaultSelected),
 NamedConstructor=Option(in DOMString text, in DOMString value, in boolean defaultSelected, in boolean selected)]
interface HTMLOptionElement : HTMLElement {
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
           attribute DOMString label;
           attribute boolean defaultSelected;
           attribute boolean selected;
           attribute DOMString value;

           attribute DOMString text;
  readonly attribute long index;
};

outputresult of a calculation in a form NEW # T

The output element represents the result of a calculation.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
for = list of ID references #
Identifies one or more elements associated with the calculation whose result this output element represents.

Tag omission #

An output element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLOutputElement : HTMLElement {
  [PutForwards=value] readonly attribute DOMSettableTokenList htmlFor;
  readonly attribute HTMLFormElement form;
           attribute DOMString name;

  readonly attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;
};

Typical default display properties #

output {
display: inline; }

pparagraph # T

The p element represents a paragraph.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

A p element must have a start tag.

A p element’s end tag may be omitted if the p element is immediately followed by an address, article, aside, blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, h4, h5, h6, header, hr, menu, nav, ol, p, pre, section, table, or ul element, or if there is no more content in the parent element and the parent element is not an a element.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

interface HTMLParagraphElement : HTMLElement {};

Typical default display properties #

p {
display: block;
margin: 1.0em 0px; }

paraminitialization parameters for plugins # T

The param element defines parameters for plugins invoked by object elements.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name of the parameter.
value = string #
The value of the parameter.

Additional constraints and admonitions #

  • The type attribute on the param element is obsolete. Use the name attribute and value attribute without declaring value types.
  • The valuetype attribute on the param element is obsolete. Use the name attribute and value attribute without declaring value types.

Tag omission #

The param element is a void element. A param element must have a start tag but must not have an end tag.

Permitted parent elements #

object

DOM interface #

interface HTMLParamElement : HTMLElement {
           attribute DOMString name;
           attribute DOMString value;
};

Typical default display properties #

param {
display: none; }

prepreformatted text # T

The pre element represents a block of preformatted text, in which structure is represented by typographic conventions rather than by elements.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

A pre element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

interface HTMLPreElement : HTMLElement {};

Typical default display properties #

pre {
display: block;
font-family: monospace;
white-space: pre;
margin: 1em 0; }

progressprogress indicator NEW # T

The progress element represents the completion progress of a task.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
value = non-negative floating-point number #
Specifies how much of the task has been completed. The units are arbitrary and not specified.
max = positive floating-point number #
Specifies how much work the task requires in total. The units are arbitrary and not specified.

Additional constraints and admonitions #

  • The element progress must not appear as a descendant of the progress element.
  • The value of the value attribute must be less than or equal to the value of the max attribute.
  • The value of the value attribute must be less than or equal to one when the max attribute is absent.

Tag omission #

A progress element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLProgressElement : HTMLElement {
           attribute double value;
           attribute double max;
  readonly attribute double position;
  readonly attribute HTMLFormElement form;
  readonly attribute NodeList labels;
};

Typical default display properties #

progress {
-webkit-block-flow: tb !important; }
progress {
display: inline-block;
height: 1em;
width: 10em;
vertical-align: -0.2em;
background-color: gray; }

qquoted text # T

The q element represents phrasing content quoted from another source.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
cite = URL potentially surrounded by spaces #
Specifies the address of the source of the quoted text.

Tag omission #

A q element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

q {
display: inline; }
q:before {
content: '"'; }
q:after {
content: '"'; }

rpruby parenthesis NEW # T

The rp element can be used to provide parentheses around a ruby text component of a ruby annotation, to be shown by UAs that don’t support ruby annotations.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

An rp element must have a start tag.

An rp element’s end tag may be omitted if the rp element is immediately followed by an rt or rp element, or if there is no more content in the parent element.

Permitted parent elements #

ruby

DOM interface #

Uses HTMLElement.

rtruby text NEW # T

The rt element marks the ruby text component of a ruby annotation.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

An rt element must have a start tag.

An rt element’s end tag may be omitted if the rt element is immediately followed by an rt or rp element, or if there is no more content in the parent element.

Permitted parent elements #

ruby

DOM interface #

Uses HTMLElement.

Typical default display properties #

rt {
text-indent: 0; }
rt {
line-height: normal; }

rubyruby annotation NEW # T

The ruby element allows spans of phrasing content to be marked with ruby annotations.

Permitted contents #

one or more of: phrasing content followed by one rt element, or one rp element, followed by one rt element, followed by one rp element

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A ruby element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

ruby {
text-indent: 0; }

sstruck text CHANGED # T

The s element represents contents that are no longer accurate or no longer relevant and that therefore has been “struck” from the document.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

An s element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Changes in HTML5 #

Although previous versions of HTML defined the s element only in presentational terms, the element has now been given the specific semantic purpose of representing contents that are no longer accurate or no longer relevant.

DOM interface #

Uses HTMLElement.

Typical default display properties #

s {
text-decoration: line-through; }

samp(sample) output # T

The samp element represents (sample) output from a program or computing system.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A samp element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

samp {
font-family: monospace; }

scriptembedded script # T

The script element enables dynamic script and data blocks to be included in documents.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
type = MIME type #
The language of the script or format of the data.
The language attribute on the script element is obsolete. You can safely omit it.
A string that identifies a valid MIME media type as defined in [RFC 2046].
language = string OBSOLETE #
Specifies that the language of the script is JavaScript.
src = Non-empty URL potentially surrounded by spaces #
The address of the external script to use.
defer = "defer" or "" (empty string) or empty #
Specifies that script should be executed after the document has been parsed.
async = "async" or "" (empty string) or empty NEW #
Specifies that the script should be executed asynchronously, as soon as it becomes available.
charset = character encoding name #
The character encoding of the external script.
A case-insensitive match for any character set name for which the IANA [Character Sets] registry has a 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.

Additional constraints and admonitions #

  • A script element must not contain an occurrence of the character sequence "<!--" without a matching later occurrence of the character sequence "-->".
  • A script element with a src attribute must contain only:
    • lines that consist solely of a newline, optionally preceded by one or more space (U+0020) characters or tab (U+0009) characters
    • single-line comments, which are lines beginning with the character sequence "//", optionally preceded by one more more space (U+0020) characters or tab (U+0009) characters, followed by any number of characters that are not a newline, and ending with a newline
    • multi-lines comments, which begin with the character sequence "/*", optionally preceded by one more more space (U+0020) characters or tab (U+0009) characters, and that end with the character sequence "*/"
  • Element script with attribute language whose value is “JavaScript” must not have attribute type whose value is not “text/javascript”.
  • Element script must not have attribute charset unless attribute src is also specified.
  • Element script must not have attribute defer unless attribute src is also specified.
  • Element script must not have attribute async unless attribute src is also specified.
  • The language attribute on the script element is obsolete. Use the type attribute instead.

Tag omission #

A script element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain metadata elements, any element that can contain phrasing elements

DOM interface #

interface HTMLScriptElement : HTMLElement {
           attribute DOMString src;
           attribute boolean async;
           attribute boolean defer;
           attribute DOMString type;
           attribute DOMString charset;
           attribute DOMString text;
};

Typical default display properties #

script {
display: none; }

sectionsection NEW # T

The section element represents a section of a document, typically with a title or heading.

Permitted contents #

zero or more style elements, followed by flow content

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

  • The sectioning element section must not appear as a descendant of the address element.

Tag omission #

A section element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

section {
display: block; }

selectoption-selection form control # T

The select element represents a control for selecting among a list of options.

Permitted contents #

zero or more optgroup elements, intermixed with zero or more option elements

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
size = positive integer #
The number of options to show to the user.
multiple = "multiple" or "" (empty string) or empty #
If present, indicates that its select element represents a control for selecting zero or more options from a list of options.
If not present, indicates that its select element represents a control for selecting a single option from a list of options.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.

Additional constraints and admonitions #

  • The interactive element select must not appear as a descendant of the a element.
  • The interactive element select must not appear as a descendant of the button element.
  • Any select element descendant of a label element with a for attribute must have an ID value that matches that for attribute.
  • The select element cannot have more than one selected option element descendant unless the multiple attribute is specified.

Tag omission #

A select element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

interface HTMLSelectElement : HTMLElement {
           attribute boolean autofocus;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
           attribute boolean multiple;
           attribute DOMString name;
           attribute boolean required;
           attribute unsigned long size;

  readonly attribute DOMString type;

  readonly attribute HTMLOptionsCollection options;
           attribute unsigned long length;
  getter any item(in unsigned long index);
  any namedItem(in DOMString name);
  void add(in HTMLElement element, in optional HTMLElement before);
  void add(in HTMLElement element, in long before);
  void remove(in long index);

  readonly attribute HTMLCollection selectedOptions;
           attribute long selectedIndex;
           attribute DOMString value;

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;
};

smallsmall print CHANGED # T

The small element represents so-called “fine print” or “small print”, such as legal disclaimers and caveats.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A small element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Changes in HTML5 #

Although previous versions of HTML defined the small element only in presentational terms, the element has now been given the specific semantic purpose of representing those parts of documents that are often referred to as “the fine print” or “the small print”.

DOM interface #

Uses HTMLElement.

Typical default display properties #

small {
font-size: smaller; }

sourcemedia source NEW # T

The source element enables multiple media sources to be specified for audio and video elements.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
src = Non-empty URL potentially surrounded by spaces #
The address of the media source.
type = MIME type #
The type of the media source (used for helping the UA determine, before fetching this media source, if it can play it).
A string that identifies a valid MIME media type as defined in [RFC 2046].
media = media-query list #
The intended media type of the media source (used for helping the UA determine, before fetching this media source, if it is useful to the user).
A valid media query list as defined in [Media Queries].

Tag omission #

The source element is a void element. A source element must have a start tag but must not have an end tag.

Permitted parent elements #

audio, video

Details #

Each separate media source specified within a source element is a complete set of media data — for example, a complete video file, or a complete audio file).

DOM interface #

interface HTMLSourceElement : HTMLElement {
           attribute DOMString src;
           attribute DOMString type;
           attribute DOMString media;
};

spangeneric span # T

The span element is a generic wrapper for phrasing content that by itself does not represent anything.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A span element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Details #

The span element is a can be used with attributes such as class, lang, xml:lang, and title to add additional semantics and structure to phrasing content.

DOM interface #

interface HTMLSpanElement : HTMLElement {};

strongstrong importance # T

The strong element represents a span of text with strong importance.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A strong element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

strong {
font-weight: bolder; }

stylestyle (presentation) information # T

The style element allows style information to be embedded in documents.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
type = MIME type #
A valid MIME type that designates a styling language.
A string that identifies a valid MIME media type as defined in [RFC 2046].
media = media-query list #
Specifies which media the styles apply to.
A valid media query list as defined in [Media Queries].
scoped = "scoped" or "" (empty string) or empty NEW #
Indicates that the specified style information is meant to apply only to the style element’s parent element, and that element’s child nodes. Otherwise, the specified styles are meant to apply to the entire document.

Additional constraints and admonitions #

  • A style element must not contain an occurrence of the character sequence "<!--" without a matching later occurrence of the character sequence "-->".

Tag omission #

A style element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain metadata elements, div, noscript, section, article, aside

DOM interface #

interface HTMLStyleElement : HTMLElement {
           attribute boolean disabled;
           attribute DOMString media;
           attribute DOMString type;
           attribute boolean scoped;
};
HTMLStyleElement implements LinkStyle;

Typical default display properties #

style {
display: none; }

subsubscript # T

The sub element represents subscript.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A sub element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

sub {
vertical-align: sub;
font-size: smaller; }

summarysummary, caption, or legend for a details control NEW # T

The summary element represents a summary, caption, or legend for a details element.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A summary element must have both a start tag and an end tag.

Permitted parent elements #

details

DOM interface #

Uses HTMLElement.

supsuperscript # T

The sup element represents superscript.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A sup element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

sup {
vertical-align: super;
font-size: smaller; }

tabletable # T

The table element represents a table; that is, data with more than one dimension.

Permitted contents #

an optional caption element, followed by zero or more colgroup elements, followed by an optional thead element, followed by one tfoot element, followed by zero or more tbody elements, or one or more tr elements or zero or more tbody elements, or one or more tr elements followed by an optional tfoot element

Permitted attributes #

global attributes
Any attributes permitted globally.
summary = string #
A prose description of the structure of the table.

Additional constraints and admonitions #

  • The element table must not appear as a descendant of the caption element.
  • The align attribute on the table element is obsolete. Use CSS instead.
  • The width attribute on the table element is obsolete. Use CSS instead.
  • The bgcolor attribute on the table element is obsolete. Use CSS instead.
  • The border attribute on the table element is obsolete. Use CSS instead.
  • The cellpadding attribute on the table element is obsolete. Use CSS instead.
  • The cellspacing attribute on the table element is obsolete. Use CSS instead.
  • The frame attribute on the table element is obsolete. Use CSS instead.
  • The rules attribute on the table element is obsolete. Use CSS instead.

Tag omission #

A table element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

Details #

Although in previous versions of HTML a table element was only allowed to contain a tfoot element if that tfoot occurred before any tbody or tr elements, but not after, the table element is now also alternatively allowed to contain a tfoot after any tbody or tr elements.

DOM interface #

interface HTMLTableElement : HTMLElement {
           attribute HTMLTableCaptionElement caption;
  HTMLElement createCaption();
  void deleteCaption();
           attribute HTMLTableSectionElement tHead;
  HTMLElement createTHead();
  void deleteTHead();
           attribute HTMLTableSectionElement tFoot;
  HTMLElement createTFoot();
  void deleteTFoot();
  readonly attribute HTMLCollection tBodies;
  HTMLElement createTBody();
  readonly attribute HTMLCollection rows;
  HTMLElement insertRow(in optional long index);
  void deleteRow(in long index);
           attribute DOMString summary;
};

Typical default display properties #

table {
display: table;
border-collapse: separate;
border-spacing: 2px;
border-color: gray; }

tbodytable row group # T

The tbody element represents a block of rows that consist of a body of data for its parent table element.

Permitted contents #

zero or more tr elements

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

A tbody element's start tag may be omitted if the first thing inside the tbody element is a tr element, and if the element is not immediately preceded by a tbody thead, or tfoot element whose end tag has been omitted.

A tbody element’s end tag may be omitted if the tbody element is immediately followed by a tbody or tfoot element, or if there is no more content in the parent element.

Permitted parent elements #

table

DOM interface #

interface HTMLTableSectionElement : HTMLElement {
  readonly attribute HTMLCollection rows;
  HTMLElement insertRow(in optional long index);
  void deleteRow(in long index);
};

Typical default display properties #

tbody {
display: table-row-group;
vertical-align: middle;
border-color: inherit; }

tdtable cell # T

The td element represents a data cell in a table.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
colspan = positive integer #
Specifies the number of adjacent columns “spanned” by its td element.
rowspan = non-negative integer #
Specifies the number of following rows “spanned” by its td element.
headers = list of ID references #
Identifies one or more th elements that apply to its td.

Additional constraints and admonitions #

  • The scope attribute on the td element is obsolete. Use the scope attribute on a th element instead.
  • The abbr attribute on the td element is obsolete. Consider instead beginning the cell contents with concise text, followed by further elaboration if needed.
  • The axis attribute on the td element is obsolete. Use the scope attribute instead.
  • The align attribute on the td element is obsolete. Use CSS instead.
  • The width attribute on the td element is obsolete. Use CSS instead.
  • The char attribute on the td element is obsolete. Use CSS instead.
  • The charoff attribute on the td element is obsolete. Use CSS instead.
  • The valign attribute on the td element is obsolete. Use CSS instead.
  • The bgcolor attribute on the td element is obsolete. Use CSS instead.
  • The height attribute on the td element is obsolete. Use CSS instead.
  • The nowrap attribute on the td element is obsolete. Use CSS instead.

Tag omission #

A td element must have a start tag.

A td element’s end tag may be omitted if the td element is immediately followed by a td or th element, or if there is no more content in the parent element.

Permitted parent elements #

tr

DOM interface #

interface HTMLTableDataCellElement : HTMLTableCellElement {};

Typical default display properties #

td {
display: table-cell;
vertical-align: inherit; }

textareatext input area # T

The textarea element represents a multi-line plain-text edit control for the element’s raw value.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
name = string #
The name part of the name/value pair associated with this element for the purposes of form submission.
disabled = "disabled" or "" (empty string) or empty #
Specifies that the element represents a disabled control.
form = ID reference NEW #
The value of the id attribute on the form with which to associate the element.
readonly = "readonly" or "" (empty string) or empty #
Specifies that element represents a control whose value is not meant to be edited.
maxlength = positive integer #
The maximum allowed value length of the element.
autofocus = "autofocus" or "" (empty string) or empty NEW #
Specifies that the element represents a control to which a UA is meant to give focus as soon as the document is loaded.
required = "required" or "" (empty string) or empty NEW #
Specifies that the element is a required part of form submission.
placeholder = string NEW #
A short hint (one word or a short phrase) intended to aid the user when entering data into the control represented by its element.
rows = positive integer #
The number of lines of text for the UA to show.
wrap = "hard" NEW #
Instructs the UA to insert line breaks into the submitted value of the textarea such that each line has no more characters than the value specified by the cols attribute.
cols = positive integer #
The expected maximum number of characters per line of text for the UA to show.
wrap = "soft" NEW #
Instructs the UA to add no line breaks to the submitted value of the textarea.

Additional constraints and admonitions #

  • The interactive element textarea must not appear as a descendant of the a element.
  • The interactive element textarea must not appear as a descendant of the button element.
  • Any textarea element descendant of a label element with a for attribute must have an ID value that matches that for attribute.

Tag omission #

A textarea element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Details #

The contents of the textarea element represent the control’s default value.

DOM interface #

interface HTMLTextAreaElement : HTMLElement {
           attribute boolean autofocus;
           attribute unsigned long cols;
           attribute boolean disabled;
           attribute DOMString dirName;
  readonly attribute HTMLFormElement form;
           attribute long maxLength;
           attribute DOMString name;
           attribute DOMString placeholder;
           attribute boolean readOnly;
           attribute boolean required;
           attribute unsigned long rows;
           attribute DOMString wrap;

  readonly attribute DOMString type;
           attribute DOMString defaultValue;
           attribute DOMString value;
  readonly attribute unsigned long textLength;

  readonly attribute boolean willValidate;
  readonly attribute ValidityState validity;
  readonly attribute DOMString validationMessage;
  boolean checkValidity();
  void setCustomValidity(in DOMString error);

  readonly attribute NodeList labels;

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
  void setSelectionRange(in unsigned long start, in unsigned long end);
};

tfoottable footer row group # T

The tfoot element represents the block of rows that consist of the column summaries (footers) for its parent table element.

Permitted contents #

zero or more tr elements

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

A tfoot element must have a start tag.

A tfoot element’s end tag may be omitted if the tfoot element is immediately followed by a tbody element, or if there is no more content in the parent element.

Permitted parent elements #

table

Details #

Although previous versions of HTML only allowed the tfoot element to occur before any tbody or tr elements, but not after, the tfoot element is now also alternatively allowed to occur after any tbody or tr elements.

DOM interface #

interface HTMLTableSectionElement : HTMLElement {
  readonly attribute HTMLCollection rows;
  HTMLElement insertRow(in optional long index);
  void deleteRow(in long index);
};

Typical default display properties #

tfoot {
display: table-footer-group;
vertical-align: middle;
border-color: inherit; }

thtable header cell # T

The th element represents a header cell in a table.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
scope = "row" or "col" or "rowgroup" or "colgroup" #
Specifies what set of cells the th element applies to.
colspan = positive integer #
Specifies the number of adjacent columns “spanned” by its th element.
rowspan = non-negative integer #
Specifies the number of following rows “spanned” by its th element.
headers = list of ID references #
Identifies one or more th elements that apply to its th.

Additional constraints and admonitions #

  • The scope attribute on the td element is obsolete. Use the scope attribute on a th element instead.
  • The abbr attribute on the th element is obsolete. Consider instead beginning the cell contents with concise text, followed by further elaboration if needed.
  • The axis attribute on the th element is obsolete. Use the scope attribute instead.
  • The align attribute on the th element is obsolete. Use CSS instead.
  • The width attribute on the th element is obsolete. Use CSS instead.
  • The char attribute on the th element is obsolete. Use CSS instead.
  • The charoff attribute on the th element is obsolete. Use CSS instead.
  • The valign attribute on the th element is obsolete. Use CSS instead.
  • The bgcolor attribute on the th element is obsolete. Use CSS instead.
  • The height attribute on the th element is obsolete. Use CSS instead.
  • The nowrap attribute on the th element is obsolete. Use CSS instead.

Tag omission #

A th element must have a start tag.

A th element’s end tag may be omitted if the th element is immediately followed by a td or th element, or if there is no more content in the parent element.

Permitted parent elements #

tr

DOM interface #

interface HTMLTableHeaderCellElement : HTMLTableCellElement {
           attribute DOMString scope;
};

Typical default display properties #

th {
display: table-cell;
vertical-align: inherit; }
th {
font-weight: bold;
text-align: center; }

theadtable heading group # T

The thead element represents the block of rows that consist of the column labels (headings) for its parent table element.

Permitted contents #

zero or more tr elements

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

A thead element must have a start tag.

A thead element’s end tag may be omitted if the thead element is immediately followed by a tbody or tfoot element.

Permitted parent elements #

table

DOM interface #

interface HTMLTableSectionElement : HTMLElement {
  readonly attribute HTMLCollection rows;
  HTMLElement insertRow(in optional long index);
  void deleteRow(in long index);
};

Typical default display properties #

thead {
display: table-header-group;
vertical-align: middle;
border-color: inherit; }

timedate and/or time NEW # T

The time element represents a date and/or time.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
datetime = date or time #
Specifies the date or time that the element represents.
Any one of the following:
pubdate = "pubdate" or "" (empty string) or empty #
Indicates that the date and time given by the element is the publication date and time of the nearest ancestor article element — or, if the element has no ancestor article element, of the document as a whole.

Additional constraints and admonitions #

  • The element time must not appear as a descendant of the time element.

Tag omission #

A time element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

Details #

If the datetime attribute is not specified, then the date or time represented is given by the contents of the element, and the character data in those contents must conform to the date-or-time datatype.

DOM interface #

interface HTMLTimeElement : HTMLElement {
           attribute DOMString dateTime;
           attribute boolean pubDate;
  readonly attribute Date valueAsDate;
};

titledocument title # T

The title element represents the document’s title or name.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A title element must have both a start tag and an end tag.

Permitted parent elements #

head

DOM interface #

interface HTMLTitleElement : HTMLElement {
           attribute DOMString text;
};

Typical default display properties #

title {
display: none; }

trtable row # T

The tr element represents a row of cells in a table.

Permitted contents #

zero or more of: one td element, or one th element

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

A tr element must have a start tag.

A tr element’s end tag may be omitted if the tr element is immediately followed by another tr element, or if there is no more content in the parent element.

Permitted parent elements #

table, thead, tfoot, tbody

DOM interface #

interface HTMLTableRowElement : HTMLElement {
  readonly attribute long rowIndex;
  readonly attribute long sectionRowIndex;
  readonly attribute HTMLCollection cells;
  HTMLElement insertCell(in optional long index);
  void deleteCell(in long index);
};

Typical default display properties #

tr {
display: table-row;
vertical-align: inherit;
border-color: inherit; }

tracksupplementary media track NEW # T

The track element enables supplementary media tracks such as subtitle tracks and caption tracks to be specified for audio and video elements.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.
kind = "subtitles" or "captions" or "descriptions" or "chapters" or "metadata" #
The kind of timed track.
  • "subtitles": Transcription or translation of the dialogue in the soundtrack of the video or audio stream; meant for users who have access to the soundtrack but for whom it is not fully usable as intended (for example, for users who do not understand the language of the soundtrack).
  • "captions": Transcription or translation of the dialogue, sound effects, relevant musical cues, and other relevant aural information in the video or audio stream; intended for cases where users do not have any access at all to the soundtrack (for example, for users who are deaf or for the case when the soundtrack is currently muted).
  • "descriptions": Textual descriptions of the visual component of a video; meant for use with audio synthesis when the visual component is unavailable (for example, for users who are blind, or for users who are currently unable to view the screen on which the video is displayed—for example, a user accessing the video while driving a car).
  • "chapters": Chapter titles.
  • "metadata": Metadata content meant for use from script.
src = Non-empty URL potentially surrounded by spaces #
The address of the timed track.
srclang = language tag #
The language of the timed track.
A valid language tag as defined in [BCP 47].
label = string #
A user-readable title for the timed track.
default = "default" or "" (empty string) or empty #
Instructs the UA that the track is to be enabled if the user’s preferences do not indicate that another track would be more appropriate.

Additional constraints and admonitions #

  • Attribute label for element track must have non-empty value.

Tag omission #

A track element must have both a start tag and an end tag.

Permitted parent elements #

audio, video

DOM interface #

interface HTMLTrackElement : HTMLElement {
           attribute DOMString kind;
           attribute DOMString src;
           attribute DOMString srclang;
           attribute DOMString label;
           attribute boolean default;

  readonly attribute TextTrack track;
};

ulunordered list # T

The ul element represents an unordered list of items; that is, a list in which changing the order of the items would not change the meaning of list.

Permitted contents #

zero or more li elements

Permitted attributes #

global attributes
Any attributes permitted globally.

Additional constraints and admonitions #

Tag omission #

A ul element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain flow elements

DOM interface #

interface HTMLUListElement : HTMLElement {};

Typical default display properties #

ul {
display: block;
list-style-type: disc;
-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
margin-start: 0;
-webkit-margin-end: 0;
padding-start: 40px; }

varvariable or placeholder text # T

The var element represents either a variable in a mathematical expression or programming context, or placeholder text that the reader is meant to mentally replace with some other literal value.

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

A var element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

Typical default display properties #

var {
font-style: italic; }

videovideo NEW # T

The video element represents a video or movie.

Permitted contents #

Transparent, with the following specific structure:

a src attribute, or one or more source elements followed by zero or more track elements, followed by flow content

or

a src attribute, or one or more source elements followed by zero or more track elements, followed by phrasing content

Permitted attributes #

global attributes
Any attributes permitted globally.
autoplay = "autoplay" or "" (empty string) or empty #
Instructs the UA to automatically begin playback of the video as soon as it can do so without stopping.
preload = "none" or "metadata" or "auto" or "" (empty string) or empty #
Represents a hint to the UA about whether optimistic downloading of the video itself or its metadata is considered worthwhile.
  • "none": Hints to the UA that the user is not expected to need the video, or that minimizing unnecessary traffic is desirable.
  • "metadata": Hints to the UA that the user is not expected to need the video, but that fetching its metadata (dimensions, first frame, track list, duration, and so on) is desirable.
  • "auto": Hints to the UA that optimistically downloading the entire video is considered desirable.
Specifying the empty string is equivalent to specifying the value "auto".
controls = "controls" or "" (empty string) or empty #
Instructs the UA to expose a user interface for controlling playback of the video.
loop = "loop" or "" (empty string) or empty #
Instructs the UA to seek back to the start of the video upon reaching the end.
poster = Non-empty URL potentially surrounded by spaces #
The address of an image file for the UA to show while no video data is available.
height = non-negative integer #
The height of the video, in CSS pixels.
width = non-negative integer #
The width of the video, in CSS pixels.
audio = list of audio states #
Represents default states of the audio channel of the video, potentially overriding user preferences.
If any values are given in the list of audio states, they instruct the UA to set default audio states, as follows:
  • muted: instructs the UA to override the user’s preferences, if any, and always default the initial audio mutedness state to muted
src = Non-empty URL potentially surrounded by spaces #
The URL for the video.

Additional constraints and admonitions #

  • The interactive element video with the attribute controls must not appear as a descendant of the a element.
  • The interactive element video with the attribute controls must not appear as a descendant of the button element.

Tag omission #

A video element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain phrasing elements, any element that can contain flow elements

DOM interface #

interface HTMLVideoElement : HTMLMediaElement {
           attribute unsigned long width;
           attribute unsigned long height;
  readonly attribute unsigned long videoWidth;
  readonly attribute unsigned long videoHeight;
           attribute DOMString poster;
  [PutForwards=value attribute DOMSettableTokenList audio; 
};

wbrline-break opportunity NEW # T

The wbr element represents a line-break opportunity.

Permitted contents #

empty (void element)

Permitted attributes #

global attributes
Any attributes permitted globally.

Tag omission #

The wbr element is a void element. A wbr element must have a start tag but must not have an end tag.

Permitted parent elements #

any element that can contain phrasing elements

DOM interface #

Uses HTMLElement.

7. Common content models # T

This section describes content models that are referenced by a number of different element descriptions in the Content model subsections of the per-element documentation in the HTML elements section.

7.1. Flow elements # T

phrasing elements or a or p or hr or pre or ul or ol or dl or div or h1 or h2 or h3 or h4 or h5 or h6 or hgroup or address or blockquote or ins or del or object or map or noscript or section or nav or article or aside or header or footer or video or audio or figure or table or form or fieldset or menu or canvas or details

7.3. Phrasing elements # T

a or em or strong or small or mark or abbr or dfn or i or b or s or code or var or samp or kbd or sup or sub or q or cite or span or bdo or bdi or br or wbr or ins or del or img or embed or object or iframe or map or area or script or noscript or ruby or video or audio or input or textarea or select or button or label or output or datalist or keygen or progress or command or canvas or time or meter

8. Global attributes # T

This section describes attributes that are common to all elements in the HTML language.

8.1. Core attributes # T

accesskey = list of key labels CHANGED #
A key label or list of key labels with which to associate the element; each key label represents a keyboard shortcut which UAs can use to activate the element or give focus to the element.
An ordered set of unique space-separated tokens, each of which must be exactly one Unicode code point in length.
class = set of space-separated tokens #
A name of a classification, or list of names of classifications, to which the element belongs.
contenteditable = "true" or "false" or "" (empty string) or empty NEW #
Specifies whether the contents of the element are editable.
contextmenu = ID reference NEW #
The value of the id attribute on the menu with which to associate the element as a context menu.
dir = "ltr" or "rtl" or "auto" #
Specifies the element’s text directionality.
draggable = "true" or "false" NEW #
Specifies whether the element is draggable.
hidden = "hidden" or "" (empty string) or empty NEW #
Specifies that the element represents an element that is not yet, or is no longer, relevant.
id = ID #
A unique identifier for the element.
There must not be multiple elements in a document that have the same id value.
Any string, with the following restrictions:

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).

lang = language tag #
Specifies the primary language for the contents of the element and for any of the element’s attributes that contain text.
A valid language tag as defined in [BCP 47].
spellcheck = "true" or "false" or "" (empty string) or empty NEW #
Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking.
style = string #
Specifies zero or more CSS declarations that apply to the element [CSS].
tabindex = integer #
Specifies whether the element represents an element that is is focusable (that is, an element which is part of the sequence of focusable elements in the document), and the relative order of the element in the sequence of focusable elements in the document.
title = normal character data #
Advisory information associated with the element.

8.2. Event-handler attributes # T

onabort = string NEW #
Load of element was aborted by the user.
onblur = string #
Element lost focus.
oncanplay = string NEW #
The UA can resume playback of media data for this video or audio element, but estimates that if playback were to be started now, the video or audio could not be rendered at the current playback rate up to its end without having to stop for further buffering of content.
oncanplaythrough = string NEW #
The UA estimates that if playback were to be started now, the video or audio element could be rendered at the current playback rate all the way to its end without having to stop for further buffering
onchange = string #
User committed a change to the value of element (form control).
onclick = string #
User pressed pointer button down and released pointer button over element, or otherwise activated the pointer in a manner that emulates such an action.
oncontextmenu = string NEW #
User requested the context menu for element.
ondblclick = string #
User clicked pointer button twice over element, or otherwise activated the pointer in a manner that simulates such an action.
ondrag = string NEW #
User is continuing to drag element.
ondragend = string NEW #
User ended dragging element.
ondragenter = string NEW #
User’s drag operation entered element.
ondragleave = string NEW #
User’s drag operation left element.
ondragover = string NEW #
User is continuing drag operation over element.
ondragstart = string NEW #
User started dragging element.
ondrop = string NEW #
User completed drop operation over element.
ondurationchange = string NEW #
The DOM attribute duration on the video or audio element has been updated.
onemptied = string NEW #
The video or audio element has returned to the uninitialized state.
onended = string NEW #
The end of the video or audio element has been reached.
onerror = string NEW #
Element failed to load properly.
onfocus = string #
Element received focus.
onformchange = string NEW #
User committed a change to the value of a form control in the form to which the element belongs.
onforminput = string NEW #
User changed the value of a form control in the form to which the element belongs.
oninput = string #
User changed the value of element (form control).
oninvalid = string NEW #
Element (form control) did not meet validity constraints.
onkeydown = string #
User pressed down a key.
onkeypress = string #
User pressed down a key that is associated with a character value.
onkeyup = string #
User released a key.
onload = string #
Element finished loading.
onloadeddata = string NEW #
UA can render the video or audio element at the current playback position for the first time.
onloadedmetadata = string NEW #
UA has just determined the duration and dimensions of the video or audio element.
onloadstart = string NEW #
UA has begun looking for media data in the video or audio element.
onmousedown = string #
User pressed down pointer button over element.
onmousemove = string #
User moved mouse.
onmouseout = string #
User moved pointer off boundaries of element.
onmouseover = string #
User moved pointer into boundaries of element or one of its descendant elements.
onmouseup = string #
User released pointer button over element.
onmousewheel = string #
User rotated wheel of mouse or other device in a manner that emulates such an action.
onpause = string NEW #
User has paused playback of the video or audio element.
onplay = string NEW #
UA has initiated playback of the video or audio element.
onplaying = string NEW #
Playback of the video or audio element has started.
onprogress = string NEW #
UA is fetching media data for the video or audio element.
onratechange = string NEW #
Either the DOM attribute defaultPlaybackRate or the DOM attribute playbackRate on the video or audio element has been updated.
onreadystatechange = string NEW #
Element and all its subresources have finished loading.
onreset = string #
The form element was reset.
onscroll = string #
Element or document view was scrolled.
onseeked = string NEW #
The value of the IDL attribute seeking changed to false (a seek operation on the video or audio element ended).
onseeking = string NEW #
The value of the IDL attribute seeking changed to true, and the seek operation on the video or audio elements is taking long enough that the UA has time to fire the seeking event.
onselect = string #
User selected some text.
onshow = string NEW #
User requested the element be shown as a context menu.
onstalled = string NEW #
UA is attempting to fetch media data for the video or audio element, but that data is not forthcoming.
onsubmit = string #
The form element was submitted.
onsuspend = string NEW #
UA is intentionally not currently fetching media data for the video or audio element, but does not yet have the entire contents downloaded.
ontimeupdate = string NEW #
The current playback position of the video or audio element changed either as part of normal playback, or in an especially interesting way (for example, discontinuously).
onvolumechange = string NEW #
Either the DOM attribute volume or the DOM attribute muted on the video or audio element has been changed.
onwaiting = string NEW #
Playback of the video or audio element has stopped because the next frame is not yet available (but UA agent expects that frame to become available in due course).

8.3. XML attributes # T

xml:lang = language tag #
As defined in the XML specification [XML].
A valid language tag as defined in [BCP 47].
xml:space = "preserve" or"default" #
As defined in the XML specification [XML].
The xml:space attribute should only be used with documents in the XML syntax; it must not be used in documents in the HTML syntax.
xml:base = URL potentially surrounded by spaces #
As defined in the XML Base specification [XMLBase].
The xml:base attribute should only be used with documents in the XML syntax; it must not be used in documents in the HTML syntax.

9. Data types (common microsyntaxes) # T

This section describes data types (microsyntaxes) that are referenced by attribute descriptions in the HTML elements, and Global attributes sections.

string #

For the purposes of this document, 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:

set of comma-separated strings #

Zero or more strings that are themselves each zero or more characters, each optionally with leading and/or trailing space characters, and each separated from the next by a single "," (comma) character. Each string itself must not begin or end with any space characters, and each string itself must not contain any "," (comma) characters.

token #

A string that does not contain any space characters.

set of space-separated tokens #

A space-separated set of zero or more token instances.

unordered set of unique space-separated tokens #

A set of space-separated tokens in which none of the tokens are duplicated.

ordered set of unique space-separated tokens #

A set of space-separated tokens in which none of the tokens are duplicated, but in which the order of the tokens is meaningful.

browsing-context name #

Any string, with the following restrictions:
  • must not start with a "_" character
  • must be at least one character long

browsing-context name or keyword #

Any string that is either of the following:

ID #

Any string, with the following restrictions:

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 reference #

A valid ID reference to an element of type type is a string that exactly matches the value of the id attribute of an element of type type anywhere in the document.

list of ID references #

name #

Any string, with the following restrictions:

hash-name reference #

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 of type type anywhere in the document.

integer #

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

positive integer #

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

non-negative integer #

One or more characters in the range 0—9.

floating-point number #

A floating-point number 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".

positive floating-point number #

A non-negative floating-point number, with the following restriction:
  • must be greater than zero

non-negative floating-point number #

A floating-point number, with the following restriction:
  • the first character may not be a "-" character

date and time #

A valid date-time as defined in [RFC 3339], with these additional qualifications:
  • the literal letters T and Z in the date/time syntax must always be uppercase
  • the date-fullyear production is instead 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

date or time #

Any one of the following:

date #

A valid full-date as defined in [RFC 3339], with the additional qualification that the year component is four or more digits representing a number greater than 0.

Example:

1996-12-19

URL #

A valid IRI reference as defined in [RFC 3987].

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

URL potentially surrounded by spaces #

A URL, optionally with leading and/or trailing space characters.

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.

Non-empty URL potentially surrounded by spaces #

A URL that is not the empty string, optionally with leading and/or trailing space characters.

absolute URL potentially surrounded by spaces #

A valid IRI as defined in [RFC 3987], optionally with leading and/or trailing space characters.

Examples:

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

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.

MIME type #

A string that identifies a valid MIME media type as defined in [RFC 2046].

character encoding name #

A case-insensitive match for any character set name for which the IANA [Character Sets] registry has a 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.

meta-charset string #

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. One of the following:

refresh value #

Any one of the following:

default-style name #

media-query list #

A valid media query list as defined in [Media Queries].

language tag #

A valid language tag as defined in [BCP 47].

list of key labels #

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

zero #

The literal string "0".

rectangle coordinates #

A comma-separated list of four integers, in exactly the following order:
  1. an integer representing the distance in CSS pixels from the left edge of the image to the left side of the rectangle
  2. an integer representing the distance in CSS pixels from the top edge of the image to the top side of the rectangle
  3. an integer, greater than the value of the first integer in this list, representing the distance in CSS pixels from the left edge of the image to the right side of the rectangle
  4. an integer, greater than the value of the second integer in this list, representing the distance in CSS pixels from the top edge of the image to the bottom side of the rectangle

circle coordinates #

A comma-separated list of three numbers, in exactly the following order:
  1. an integer representing the distance in CSS pixels from the left edge of the image to the center of the circle
  2. an integer representing the distance in CSS pixels from the top edge of the image to the center of the circle
  3. a non-negative integer, representing the radius of the circle, in CSS pixels

polygon coordinates #

A comma-separated list of at least six integers, with the total number of integers in the list being even (that is, six or eight or ten numbers, and so on). Each pair of integers represents a coordinate, in CSS pixels, given as the distances from, respectively, the left and the top of the image; all the coordinates together represent the points of the polygon, in order.

sandbox “allow” keywords list #

An unordered set of unique space-separated tokens, each of which is a case-insensitive match for one of the following literal strings:
  • "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:

list of audio states #

An unordered set of unique space-separated tokens, each of which is a case-insensitive match for one of the following literal strings:
  • "muted"

Currently, "muted" is the only token defined.

Because an unordered set of unique space-separated tokens can contain zero tokens, this datatype also allows the following:

list of MIME types #

A set of comma-separated strings, each of which is a valid MIME type, with no parameters.

list of character-encoding names #

pattern #

A regular expression that must match the JavaScript Pattern production as specified in [ECMA 262].

local date and time #

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

date #

A valid full-date as defined in [RFC 3339], with the additional qualification that the year component is four or more digits representing a number greater than 0.

Example:

1996-12-19

month #

The following parts, in exactly the following order:
  1. Four or more digits representing a number greater than 0.
  2. The literal string "-".
  3. Two digits, representing the month month, in the range 1 ≤ month, ≤ 12.

Example:

1996-12

week #

The following parts, in exactly the following order:
  1. Four or more digits representing year year, where year > 0.
  2. The literal string "-W".
  3. Two digits, representing the week week, in the range 1 ≤ weekmaxweek, where maxweek is either 52 or 53, depending on the particular year.

Example:

1996-W16

time #

A valid partial-time as defined in [RFC 3339].

Examples:

23:20:50.52
17:39:57

e-mail address #

Any string that matches the following [ABNF] production:
1*( atext / "." ) "@" ldh-str 1*( "." ldh-str )

…where atext is as defined in [RFC 5322], and ldh-str is as defined in [RFC 1034].

Examples:

foo-bar.baz@example.com

list of e-mail addresses #

A set of comma-separated strings, each of which is a valid email address.

simple 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.

Color keywords (for example, strings such as “red” or “green”) are not allowed.

A. References # T

ABNF
Augmented BNF for Syntax Specifications: ABNF. D. Crocker, P. Overell.
BCP 47
Tags for Identifying Languages. A. Phillips, M. Davis.
(for examples of language tags, see in particular http://tools.ietf.org/html/bcp47#appendix-A)
BIDI
Unicode Standard Annex #9: Unicode Bidirectional Algorithm. M. Davis.
Character Sets
Character Sets. Internet Assigned Numbers Authority (IANA).
CSS
Cascading Style Sheets (CSS) Snapshot 2007. Elika J. Etemad.
DOM Core
Document Object Model (DOM) Level 3 Core. Arnaud Le Hors, Philippe Le Hégaret, Lauren Wood, Gavin Nicol, Jonathan Robie, Mike Champion, Steve Byrne. W3C Recommendation.
(see in particular http://www.w3.org/TR/DOM-Level-3-Core/introduction.html and http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent)
ECMA 262
ECMAScript Language Specification. 5th edition.
(see in particular http://www.w3.org/TR/xml-entity-names/byalpha.html)
HTML5
HTML 5: A vocabulary and associated APIs for HTML and XHTML. Ian Hickson. W3C Editor’s Draft.
HTML5 for Web Authors
HTML5 (Edition for Web Authors). Ian Hickson. W3C Editor’s Draft.
Media Queries
Media Queries. Håkon Wium Lie, Tantek Çelik, Daniel Glazman, Anne van Kesteren. W3C Candidate Recommendation.
(see in particular http://www.w3.org/TR/2009/CR-css3-mediaqueries-20090915/#syntax)
Namespaces in XML
Namespaces in XML 1.0. Tim Bray, Dave Hollander, Andrew Layman, Richard Tobin. W3C Recommendation.
RFC 1034
Internet Message Format. P. Mockapetris.
(see in particular http://tools.ietf.org/html/rfc1034#section-3.5
RFC 2046
Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types. N. Freed, N. Borenstein.
(see in particular http://tools.ietf.org/html/rfc2046#section-2)
RFC 3339
Date and Time on the Internet: Timestamps. G. Klyne, C. Newman.
(see in particular http://tools.ietf.org/html/rfc3339#section-5.6)
RFC 3987
Internationalized Resource Identifiers (IRIs). M. Duerst, M. Suignard.
(see in particular http://tools.ietf.org/html/rfc3987#section-2.2)
RFC 5322
Internet Message Format. P. Resnick.
(see in particular http://tools.ietf.org/html/rfc5322#section-3.2.3)
XML
Extensible Markup Language (XML) 1.0. Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve Maler, François Yergeau. W3C Recommendation.
XMLBase
XML Base. Jonathan Marsh, Richard Tobin. W3C Recommendation.
XML Entities
XML Entity definitions for Characters. David Carlisle, Patrick Ion. W3C Recommendation.

B. Acknowledgments # T

This document incorporates a modified version of a CSS stylesheet from the WebKit source repository, distributed with the following copyright notice and license statement:

Copyright (C) 2000 Lars Knoll (knoll@kde.org)
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB.  If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.

This document incorporates modified and verbatim content from the document HTML5, distributed with the following copyright notice and license statement:

Copyright © 2010 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.

Index of terms # T

ABNF (specification)

absolute URL potentially surrounded by spaces

ambiguous ampersand

application cache manifest

ASCII-compatible character encoding

attribute names

attribute values

attributes

BCP 47 (specification)

BIDI (specification)

browsing context

browsing-context name

browsing-context name or keyword

case-insensitive match

CDATA end delimiter

CDATA sections in SVG and MathML contents

CDATA start delimiter

character data

character encoding declaration

character encoding name

character references

Character Sets (specification)

circle coordinates

comment end delimiter

comment start delimiter

comments

content model

contents

context menu

CSS (specification)

date

date

date and time

date or time

decimal numeric character reference

default-style name

defined metadata name

deprecated doctype

description list

description or value

doctype

document

document in the HTML syntax

document in the XML syntax

DOM Core (specification)

DOM tree

double-quoted attribute value

double-quoted attribute-value syntax

e-mail address

ECMA 262 (specification)

empty attribute syntax

empty hyperlink

encoding declaration state

end tags

fallback content

floating-point number

flow content

hash-name reference

hexadecimal numeric character reference

HTML consumers

HTML elements

HTML language

HTML namespace

HTML parser

HTML producers

HTML syntax

HTML5 (specification)

HTML5 for Web Authors (specification)

ID

ID reference

integer

language tag

legacy-tool-compatible doctype

list of audio states

list of character-encoding names

list of e-mail addresses

list of ID references

list of key labels

list of MIME types

local date and time

marked as self-closing

Media Queries (specification)

media-query list

media source

meta-charset string

MIME type

misnested tag

month

must

name

named character reference

named hyperlink

namespace-well-formed

Namespaces in XML (specification)

newline

Non-empty URL potentially surrounded by spaces

non-negative floating-point number

non-negative integer

non-replaceable character data

normal character data

normal doctype

omitted

ordered set of unique space-separated tokens

pattern

permitted-public-ID-system-ID-combination

phrasing content

placeholder hyperlink

polygon coordinates

positive floating-point number

positive integer

public ID

rectangle coordinates

refresh value

registered metadata name

replaceable character data

resolve a URL

RFC 1034 (specification)

RFC 2046 (specification)

RFC 3339 (specification)

RFC 3987 (specification)

RFC 5322 (specification)

root element

sandbox “allow” keywords list

set of comma-separated strings

set of space-separated tokens

simple color

single-quoted attribute value

single-quoted attribute-value syntax

sizes

space

start tags

string

SVG and MathML elements

system ID

tag names

tags

term or name

text

text content

time

token

top-level browsing context

transparent

UA

unordered set of unique space-separated tokens

unquoted attribute value

unquoted attribute-value syntax

URL

URL potentially surrounded by spaces

void element

void elements in HTML

week

XML (specification)

XML-compatible

XML declaration

XML Entities (specification)

XML parser

XML syntax

XMLBase (specification)

zero