W3C

HTML: The Markup Language

W3C Working Draft 4 March 2010

This Version:
http://www.w3.org/TR/2010/WD-html-markup-20100304/
Latest Published Version:
http://www.w3.org/TR/html-markup/
Latest Editor’s Draft:
http://dev.w3.org/html5/markup/
Editor:
Michael(tm) Smith, W3C <mike@w3.org>

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


Abstract

This document describes the HTML markup language and provides details necessary for producers of HTML content to create documents that conform to the language. By design, it does not define related APIs, nor attempt to specify how consumers of HTML content are meant to process documents, nor attempt to 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 4 March 2010 First Public Working Draft of HTML: The Markup Language. 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.

This non-normative document is intended to complement the normative conformance criteria defined in the specification HTML5: A vocabulary and associated APIs for HTML and XHTML [HTML5], and is similar in scope to the HTML5 (Author Edition) subset of that specification [HTML5AUTHOR].

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

Full Table of Contents #

1. Introduction # T

This specification provides the details necessary for producers of HTML content to create conformant documents, and for others to check the conformance of existing documents. It is designed:

Certain purposes are intentionally out of scope for this specification; in particular, it:

2. Terminology # T

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

browsing context
A browsing context is 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
For the purposes of this specification, performing a case-insensitive match between two strings means comparing the strings exactly, 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.
fallback content
Some embedded content elements can have fallback content: content that is to be used when the embedded content cannot be used (for example, when it 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.
newline
A newline may be represented as 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
Phrasing content consists of phrasing elements intermixed with normal character data.
space
A space character is 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)
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

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.01. The HTML language and HTML and XML syntaxes # T

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

The HTML language is the language described in this specification; 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 specification makes reference to two particular concrete syntaxes for the HTML language: One syntax which is referred to throughout this specification as the HTML syntax, and another syntax, which is referred to throughout this specification 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 specification.

The XML syntax is defined by rules in the XML specification [XML] and in the Namespaces in XML 1.0 specification [XMLNS]. Beyond the requirements defined in those specifications, this specification does not define any additional syntax-level requirements for documents in the XML syntax.

3.02. 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 conform to the rules in this specification for 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 conform to the rules in this specification for documents in the XML syntax.

3.03. Conformant documents # T

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 and contents.
  6. Any number of comments and space characters.

Documents in the HTML syntax must conform to the syntax described in the HTML syntax section of this specification.

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

Documents in the XML syntax must conform to XML constraints as defined in the XML specification [XML] and in the Namespaces in XML 1.0 specification [XMLNS] — including XML well-formedness constraints — and 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.04. 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 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 [XML] and in the Namespaces in XML 1.0 specification [XMLNS]).

This section is divided into the following parts:

4.01. 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 conform to one of the following three formats:

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

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

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

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

4.02. 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. [IANACHARSET]
  • 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.03. 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 specification defines 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.

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 specification 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 specification 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.01. 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.04. 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 specification defines further restrictions on the allowed values of all attributes that are part of the HTML language. An attribute must not have a value that is not allowed by the content model of the element that contains it.

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:

  • must not contain any literal space characters
  • must not contain any """, "'", ">", "=", characters
  • must not be the empty string

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.05. 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:

  • must not contain any ambiguous ampersands
  • must not contain any occurrences of the string "</" followed by characters that are a case-insensitive match for the tag name of the element containing the replaceable character data (for example, "</title" or "</textarea"), followed by a space character, ">", or "/".

Replaceable character data, as defined in this specification, 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 defined in this specification; instead they must conform to all syntax constraints defined 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:

  • must not contain character references
  • must not contain any occurrences of the string "</", followed by characters that are a case-insensitive match for the tag name of the element containing the replaceable character data (for example, "</script" or "</style", followed by a space character, ">", or "/".

Non-replaceable character data, as defined in this specification, 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 defined in this specification; instead they must conform to all syntax constraints defined in the XML specification [XML].

4.06. 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 defined in XML Entity definitions for Characters [Entities], using the same case.
  3. A ";" character.

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.07. 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.08. 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.09. 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 # T

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

ahyperlink # T

The a element represents a hyperlink.

Permitted content #

Permitted attributes #

Descriptions for attributes specific to this element #

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.
href = URI
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.
rel = 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.
media = media-query list NEW
The media for which the destination of the hyperlink was designed.
type = MIME type
The MIME type of the destination of the hyperlink.
ping = list of URIs NEW
A list of URLs to notify if a user follows the hyperlink.

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 target attribute on the a element is obsolete. You can safely omit it.
  • 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

Details #

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

Although previous versions of HTML restricted the a element to only containing phrasing content, the a element is now transparent; and so is now also allowed to contain flow content if its parent element is is allowed to contain flow content.

DOM interface #

interface HTMLAnchorElement : HTMLElement {
  stringifier attribute DOMString href;
           attribute DOMString target;
           attribute DOMString ping;
           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); }

abbrabbreviation # T

The abbr element represents an abbreviation or acronym.

Permitted content #

Permitted attributes #

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 content #

Permitted attributes #

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 content #

empty (void element)

Permitted attributes #

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

Descriptions for attributes specific to this element #

alt = normal character data
The fallback content for the image map.
href = URI
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.
ping = list of URIs NEW
A list of URLs to notify if a user follows the hyperlink for this area.
rel = 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.
hreflang = language tag NEW
The language of the destination of the hyperlink.
type = MIME type
The MIME type of the destination of the hyperlink.
shape = "rect" & coords = rectangle
Specifies that the shape of the area of this hyperlink on the image map is a rectangle.
shape = "circle" & coords = circle
Specifies that the shape of the area of this hyperlink on the image map is a circle.
shape = "poly" & coords = polygon
Specifies that the shape of the area of this hyperlink on the image map is a polygon.
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 ping;
           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 content #

zero or more style elements, followed by flow content

Permitted attributes #

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 content #

zero or more style elements, followed by flow content

Permitted attributes #

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 content #

Transparent, with the following specific structure:

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

or

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

Permitted attributes #

Descriptions for attributes specific to this element #

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 = "preload" or "" (empty string) or empty
Instructs the UA that downloading the entire audio stream optimistically is considered worthwhile.
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 = URI
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 typically styled in bold CHANGED # T

The b element represents a span of text offset from its surrounding content without conveying any extra importance; for example, keywords in a document abstract, product names in a review, or other spans of text whose typical typographic presentation is bold text.

Permitted content #

Permitted attributes #

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

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 content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

href = URI
The base URL for the document.
target = browsing-context name or keyword NEW
A browsing context name or keyword for use in following hyperlinks.

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;
};

bdoBiDi override # T

The bdo element provides a means to specify a direction override of the Unicode BiDi algorithm.

Permitted content #

Permitted attributes #

Additional constraints and admonitions #

  • A bdo element must have an 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 content #

Permitted attributes #

Descriptions for attributes specific to this element #

cite = URI
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 content #

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 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 content #

empty (void element)

Permitted attributes #

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 {};

button # T

See 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 content #

Descriptions for attributes specific to this 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.

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 content #

Permitted attributes #

Descriptions for attributes specific to this 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.

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 content #

Permitted attributes #

Descriptions for attributes specific to this 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.

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 content #

Permitted attributes #

Descriptions for attributes specific to this element #

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);
};

captiontable title # T

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

Permitted content #

Permitted attributes #

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 # 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 content #

Permitted attributes #

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

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 content #

Permitted attributes #

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 content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

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 content #

zero or more col elements, or an optional span attribute

Permitted attributes #

Descriptions for attributes specific to this element #

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; }

command NEW # T

See 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 content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

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 = URI
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 content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

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 = URI
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 content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

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 = URI
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 content #

zero or more option elements, intermixed with phrasing content

Permitted attributes #

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 content #

Permitted attributes #

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 dt 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 content #

Permitted attributes #

Descriptions for attributes specific to this element #

cite = URI
The address of a document that explains why the text was deleted.
datetime = date-time
The time and date when the text was deleted.

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 content #

an optional summary element, followed by flow content

Permitted attributes #

Descriptions for attributes specific to this element #

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 content #

Permitted attributes #

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 content #

zero or more style elements, followed by flow content

Permitted attributes #

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 content #

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

Permitted attributes #

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;
margin: 1em 0 1em 0; }

dtterm or name # T

The dt element represents a term or name.

Permitted content #

Permitted attributes #

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 CHANGED # T

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

Permitted content #

Permitted attributes #

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 content #

empty (void element)

Permitted attributes #

common attributes & src & type & height & width & Any other attribute that has no namespace

Descriptions for attributes specific to this element #

src = URI
The address of the content being embedded.
type = MIME type
The MIME type of the plugin to instantiate.
height = positive integer
The height of the embedded content, in CSS pixels.
width = positive 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.

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 content #

an optional legend element, followed by flow content

Permitted attributes #

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-left: 2px;
margin-right: 2px;
padding: 0.35em 0.75em 0.625em;
border: 2px groove (internal value); }

figcaptionfigure caption NEW # T

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

Permitted content #

Permitted attributes #

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 content #

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

Permitted attributes #

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 content #

Descriptions for attributes specific to this element #

action = URI
The submission action for the form.
method = "get" or "post" or "put" or "delete"
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.
accept-charset = character-encoding name list
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.
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 boolean autocomplete;
           attribute DOMString enctype;
           attribute DOMString method;
           attribute DOMString name;
           attribute boolean noValidate;
           attribute DOMString target;

  readonly attribute HTMLFormControlsCollection elements;
  readonly attribute long length;
  caller getter any item(in unsigned long index);
  caller getter any namedItem(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 content #

Permitted attributes #

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 content #

Permitted attributes #

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 content #

Permitted attributes #

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 content #

Permitted attributes #

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 content #

Permitted attributes #

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 content #

Permitted attributes #

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 content #

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 #

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.

hrthematic break CHANGED # T

The hr element represents a paragraph-level thematic break.

Permitted content #

empty (void element)

Permitted attributes #

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

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 content #

one head element, followed by one body element

Permitted attributes #

Descriptions for attributes specific to this element #

manifest = URI 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 typically styled in italic # T

The i element represents a span of text in an alternate voice or mood, or otherwise offset from the normal prose (content whose typical typographic presentation is italicized).

Permitted content #

Permitted attributes #

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

Details #

Some examples of spans that might use the i element include a taxonomic designation, a technical term, an idiomatic phrase from another language, a thought, a ship name, or some other prose whose typical typographic presentation is italicized.

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 content #

Permitted attributes #

Descriptions for attributes specific to this element #

src = URI
The address of a page that the nested browsing context is to contain.
name = browsing-context name
A valid browsing context name.
width = positive integer
The width of the iframe, in CSS pixels.
height = positive integer
The height of the iframe, in CSS pixels.
sandbox = sandbox allow list NEW
Instructs the UA to enable a set of extra restrictions on any content hosted by the iframe.
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 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 content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

src = URI
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.

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;
};

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 content #

empty (void element)

Descriptions for attributes specific to this element #

type = "text"
Specifies that its input element is a one-line plain-text edit control for the input element’s value.
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.
  • 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 boolean autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute  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  valueAsDate;
           attribute float 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 content #

empty (void element)

Descriptions for attributes specific to this element #

type = "password"
Specifies that its input element is a one-line plain-text edit control for entering a password.
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.
  • 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 boolean autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute  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  valueAsDate;
           attribute float 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 content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

type = "checkbox"
Specifies that its input element represents a state or option that can be toggled.
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.
  • 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 boolean autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute  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  valueAsDate;
           attribute float 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 content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

type = "radio"
Specifies that its input element represents a selection of one item from a list of items.
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.
  • 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 boolean autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute  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  valueAsDate;
           attribute float 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 content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

type = "button"
Specifies that its input element is a button with no additional semantics.
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.
  • 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 boolean autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute  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  valueAsDate;
           attribute float 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 content #

empty (void element)

Descriptions for attributes specific to this element #

type = "submit"
Specifies that its input element is a button for submitting a form.
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.
  • 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 boolean autocomplete;
           attribute boolean autofocus;
           attribute boolean defaultChecked;
           attribute boolean checked;
           attribute boolean disabled;
  readonly attribute HTMLFormElement form;
  readonly attribute  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  valueAsDate;
           attribute float 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 content #

empty (void element)

Permitted attributes #

Descriptions for attributes specific to this element #

type = "reset"
Specifies that its input element is a button for resetting a form.