Authors and documents must not use the features listed in this section. They are documented to enable user agents to support legacy content in an interoperable fashion.
The following elements are entirely obsolete:
appletacronymUse abbr instead.
dirUse ul instead.
frameframesetnoframesUse iframe and CSS instead.
isindexUse an explicit form and text field combination instead.
noembedbasefontbigblinkcenterfontmarqueesspacerstrikettuUse CSS instead.
The following attributes are obsolete (though the elements are still part of the language):
charset on a elementscharset on link elementsUse an HTTP Content-Type header on the linked resource instead.
coords on a elementsshape on a elementsrev on a elementsrev on link elementsUse the rel
attribute instead, with an opposite term. (For example, instead of
rev="made", use rel="author".)
name on a elementsname on img elementsUse the id attribute instead.
nohref on area elementsOmitting the href
attribute is sufficient; the nohref attribute is
unnecessary. Omit it altogether.
profile on head elementsWhen used for declaring which meta terms are
used in the document, unnecessary; omit it altogether, and register the names.
When used for triggering specific user agent behaviors: use
a link element instead.
version on html elementsUnnecessary. Omit it altogether.
usemap on input elementslongdesc on iframe elementslongdesc on img elementsUse a regular a element to link to the description.
target on link elementsUnnecessary. Omit it altogether.
scheme on meta elementsUse only one scheme per field, or make the scheme declaration part of the value.
archive on object elementscode on object elementscodebase on object elementscodetype on object elementsdeclare on object elementsRepeat the object element completely each time the resource is to be reused.
standby on object elementsOptimise the linked resource so that it loads quickly or, at least, incrementally.
type on param elementsvaluetype on param elementsUse the name and value attributes without declaring
value types.
summary on table elementsUse the caption element instead.
abbr on td and th elementsUse text that begins in an unambiguous and terse manner, and include any more elaborate text after that.
axis on td and th elementsUse the scope attribute.
alink on body elementsbackground on body elementsbgcolor on body elementslink on body elementstext on body elementsvlink on body elementsclear on br elementsalign on caption elementsalign on col elementsch on col elementschOff on col elementsvalign on col elementswidth on col elementsalign on div elementscompact on dl elementsalign on hr elementsnoshade on hr elementssize on hr elementswidth on hr elementsalign on h1—h6 elementsalign on iframe elementsframeborder on iframe elementsmarginheight on iframe elementsmarginwidth on iframe elementsscrolling on iframe elementsalign on input elementsalign on img elementsborder on img elementshspace on img elementsvspace on img elementsalign on legend elementstype on li elementscompact on menu elementsalign on object elementsborder on object elementshspace on object elementsvspace on object elementscompact on ol elementstype on ol elementsalign on p elementswidth on pre elementsalign on table elementsbgcolor on table elementsborder on table elementscellpadding on table elementscellspacing on table elementsframe on table elementsrules on table elementswidth on table elementsalign on tbody, thead, and tfoot elementsch on tbody, thead, and tfoot elementschOff on tbody, thead, and tfoot elementsvalign on tbody, thead, and tfoot elementsalign on td and th elementsbgColor on td and th elementsch on td and th elementschOff on td and th elementsheight on td and th elementsnoWrap on td and th elementsvAlign on td and th elementswidth on td and th elementsalign on tr elementsbgcolor on tr elementsch on tr elementschOff on tr elementsvalign on tr elementscompact on ul elementstype on ul elementsUse CSS instead.
applet elementThe applet element is a Java-specific variant of the
embed element. The applet element is now
obsoleted so that all extension frameworks (Java, .NET, Flash, etc)
are handled in a consistent manner.
When the sandboxed plugins
browsing context flag is set on the browsing
context for which the applet element's document
is the active document, and when the element has an
ancestor object element that is not showing
its fallback content, the element must be ignored (it
represents nothing).
Otherwise, define how the element works, if supported.
The applet element must implement the
HTMLAppletElement interface.
interface HTMLAppletElement : HTMLElement { attribute DOMString align; attribute DOMString alt; attribute DOMString archive; attribute DOMString code; attribute DOMString codeBase; attribute DOMString height; attribute long hspace; attribute DOMString name; attribute DOMString object; attribute long vspace; attribute DOMString width; };
The align, alt, archive, code, height, hspace, name, object, vspace, and width DOM attributes
must reflect the respective content attributes of the
same name.
The codeBase
DOM attribute must reflect the codebase content attribute.
marquee elementThe marquee element is a presentational element that
animates content. CSS transitions and animations are a more
appropriate mechanism.
The task source for tasks mentioned in this section is the DOM manipulation task source.
The marquee element must implement the
HTMLMarqueeElement interface.
interface HTMLMarqueeElement : HTMLElement { attribute DOMString behavior; attribute DOMString bgColor; attribute DOMString direction; attribute DOMString height; attribute unsigned long hspace; attribute long loop; attribute unsigned long scrollAmount; attribute unsigned long scrollDelay; attribute DOMString trueSpeed; attribute unsigned long vspace; attribute DOMString width; attribute Function onbounce; attribute Function onfinish; attribute Function onstart; void start() void stop() };
A marquee element can be turned on or turned off. When it is created, it
is turned on.
When the start() method is
called, the marquee element must be turned on.
When the stop()
method is called, the marquee element must be turned off.
When a marquee element is created, the user agent
must queue a task to fire a simple event
called start at the element.
The behavior content
attribute on marquee elements is an enumerated
attribute with the following keywords (all
non-conforming):
| Keyword | State |
|---|---|
scroll
| scroll |
slide
| slide |
alternate
| alternate |
The missing value default is the scroll state.
The direction content
attribute on marquee elements is an enumerated
attribute with the following keywords (all
non-conforming):
| Keyword | State |
|---|---|
left
| left |
right
| right |
up
| up |
down
| down |
The missing value default is the left state.
The truespeed content
attribute on marquee elements is an enumerated
attribute with the following keywords (all
non-conforming):
| Keyword | State |
|---|---|
true
| true |
false
| false |
The missing value default is the false state.
A marquee element has a marquee scroll
interval, which is obtained as follows:
If the element has a scrolldelay attribute, and
parsing its value using the rules for parsing non-negative
integers does not return an error, then let delay be the parsed value. Otherwise, let delay be 85.
If the element does not have a truespeed attribute, or if it
does but that attribute is in the false state, and the
delay value is less than 60, then let delay be 60 instead.
The marquee scroll interval is delay, interpreted in milliseconds.
A marquee element has a marquee scroll
distance, which, if the element has a scrollamount attribute, and
parsing its value using the rules for parsing non-negative
integers does not return an error, is the parsed value
interpreted in CSS pixels, and otherwise is 6 CSS pixels.
A marquee element has a marquee loop
count, which, if the element has a loop attribute, and parsing its
value using the rules for parsing integers does not
return an error or a number less than 1, is the parsed value, and
otherwise is −1.
The loop DOM
attribute, on getting, must return the element's marquee loop
count; and on setting, if the new value is different than the
element's marquee loop count and either greater than
zero or equal to −1, must set the element's loop content attribute (adding it
if necessary) to the valid integer that represents the
new value. (Other values are ignored.)
A marquee element also has a marquee current
loop index, which is zero when the element is created.
The rendering layer will occasionally increment the marquee current loop index, which must cause the following steps to be run:
If the marquee loop count is −1, then abort these steps.
Increment the marquee current loop index by one.
If the marquee current loop index is now equal to
or greater than the element's marquee loop count,
turn off the
marquee element and queue a task to
fire a simple event called finish at the marquee
element.
Otherwise, if the behavior attribute is in the
alternate
state, then queue a task to fire a simple
event called bounce at
the marquee element.
Otherwise, queue a task to fire a simple
event called start at the
marquee element.
The following are the event handler attributes (and
their corresponding event
handler event types) that must be supported, as content and
DOM attributes, by marquee elements:
| event handler attribute | Event handler event type |
|---|---|
onbounce | bounce
|
onfinish | finish
|
onstart | start
|
The behavior, direction, height, hspace, vspace, and width DOM attributes
must reflect the respective content attributes of the
same name.
The bgColor
DOM attribute must reflect the bgcolor content attribute.
The scrollAmount
DOM attribute must reflect the scrollamount content
attribute. The default value is 6.
The scrollDelay DOM
attribute must reflect the scrolldelay content
attribute. The default value is 85.
The trueSpeed DOM
attribute must reflect the truespeed content
attribute.
The frameset element acts as the
body element in documents that use frames.
The frameset element must implement the
HTMLFrameSetElement interface.
interface HTMLFrameSetElement : HTMLElement { attribute DOMString cols; attribute DOMString rows; 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 onredo; attribute Function onresize; attribute Function onstorage; attribute Function onundo; attribute Function onunload; };
The cols and
rows DOM
attributes of the frameset element must
reflect the respective content attributes of the same
name.
The frameset element must support the following
event handler content attributes exposing the
event handler attributes of the Window
object:
onafterprintonbeforeprintonbeforeunloadonbluronerroronfocusonhashchangeonloadonmessageonofflineononlineonpopstateonredoonresizeonstorageonundoonunloadThe DOM interface also exposes event handler DOM
attributes that mirror those on the Window
element.
The onblur, onerror, onfocus, and onload event handler
attributes of the Window object, exposed on the
frameset element, shadow the generic event
handler attributes with the same names normally supported by
HTML elements.
The frame element defines a nested
browsing context similar to the iframe element,
but rendered within a frameset element.
When the browsing context is created, if a src attribute is present, the user
agent must resolve the value of
that attribute, relative to the element, and if that is successful,
must then navigate the element's browsing context to
the resulting absolute URL, with replacement
enabled, and with the frame element's
document's browsing context as the source
browsing context.
Whenever the src attribute
is set, the user agent must resolve the value of that attribute, relative to the
element, and if that is successful, the nested browsing
context must be navigated to
the resulting absolute URL, with the
frame element's document's browsing
context as the source browsing context.
When the browsing context is created, if a name attribute is present, the
browsing context name must be set to the value of this
attribute; otherwise, the browsing context name must be
set to the empty string.
Whenever the name attribute
is set, the nested browsing context's name must be changed to the new
value. If the attribute is removed, the browsing context
name must be set to the empty string.
When content loads in a frame, after any load events are fired within the content
itself, the user agent must fire a simple event called
load at the frame
element. When content fails to load (e.g. due to a network error),
then the user agent must fire a simple event called
error at the element instead.
When there is an active parser in the
frame, and when anything in the frame is
delaying the load event of
the frame's browsing context's
active document, the frame must
delay the load event of its document.
The frame element must implement the
HTMLFrameElement interface.
interface HTMLFrameElement : HTMLElement { attribute DOMString frameBorder; attribute DOMString longDesc; attribute DOMString marginHeight; attribute DOMString marginWidth; attribute DOMString name; attribute boolean noResize; attribute DOMString scrolling; attribute DOMString src; readonly attribute Document contentDocument; };
The name, scrolling, and src DOM attributes of the
frame element must reflect the respective
content attributes of the same name.
The frameBorder DOM
attribute of the frame element must
reflect the element's frameborder content
attribute.
The longDesc
DOM attribute of the frame element must
reflect the element's longdesc content attribute.
The marginHeight DOM
attribute of the frame element must
reflect the element's marginheight content
attribute.
The marginWidth DOM
attribute of the frame element must
reflect the element's marginwidth content
attribute.
The noResize
DOM attribute of the frame element must
reflect the element's noresize content attribute.
The contentDocument
DOM attribute of the frame element must return the
Document object of the active document of
the frame element's nested browsing
context.
[Supplemental] interface HTMLAnchorElement { attribute DOMString coords; attribute DOMString charset; attribute DOMString rev; attribute DOMString shape; };
The coords, charset, rev, and shape DOM attributes of the
a element must reflect the respective
content attributes of the same name.
[Supplemental] interface HTMLAreaElement { attribute boolean noHref; };
The noHref DOM
attribute of the area element must reflect
the element's nohref content
attribute.
The basefont element must implement the
HTMLBaseFontElement interface.
interface HTMLBaseFontElement : HTMLElement { attribute DOMString color; attribute DOMString face; attribute long size; };
The color,
face, and size DOM attributes of
the basefont element must reflect the
respective content attributes of the same name.
[Supplemental] interface HTMLBodyElement { attribute DOMString text; attribute DOMString bgColor; attribute DOMString background; attribute DOMString link; attribute DOMString vLink; attribute DOMString aLink; };
The text DOM
attribute of the body element must reflect
the element's text content
attribute.
The bgColor DOM
attribute of the body element must reflect
the element's bgcolor content
attribute.
The background DOM
attribute of the body element must reflect
the element's background
content attribute. (The background content is
not defined to contain a URL, despite rules
regarding its handling in the rendering section above.)
The link DOM
attribute of the body element must reflect
the element's link content
attribute.
The aLink DOM
attribute of the body element must reflect
the element's alink content
attribute.
The vLink DOM
attribute of the body element must reflect
the element's vlink content
attribute.
[Supplemental] interface HTMLBRElement { attribute DOMString clear; };
The clear DOM
attribute of the br element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLTableCaptionElement { attribute DOMString align; };
The align DOM
attribute of the caption element must
reflect the content attribute of the same name.
[Supplemental] interface HTMLTableColElement { attribute DOMString align; attribute DOMString ch; attribute DOMString chOff; attribute DOMString vAlign; attribute DOMString width; };
The align, ch, and width, DOM attributes of
the col element must reflect the
respective content attributes of the same name.
The chOff DOM
attribute of the col element must reflect
the element's choff content
attribute.
The vAlign DOM
attribute of the col element must reflect
the element's valign content
attribute.
The dir element must implement the
HTMLDirectoryElement interface.
interface HTMLDirectoryElement : HTMLElement { attribute DOMString compact; };
The compact DOM
attribute of the dir element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLDivElement { attribute DOMString align; };
The align DOM
attribute of the div element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLDListElement { attribute DOMString compact; };
The compact DOM
attribute of the dl element must reflect
the content attribute of the same name.
The font element must implement the
HTMLFontElement interface.
interface HTMLFontElement : HTMLElement { attribute DOMString color; attribute DOMString face; attribute DOMString size; };
The color,
face, and size DOM attributes of
the font element must reflect the
respective content attributes of the same name.
[Supplemental] interface HTMLHeadingElement { attribute DOMString align; };
The align DOM
attribute of the h1–h6 elements must
reflect the content attribute of the same name.
[Supplemental] interface HTMLHeadElement { attribute DOMString profile; };
The profile DOM
attribute of the head element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLHRElement { attribute DOMString align; attribute boolean noShade; attribute DOMString size; attribute DOMString width; };
The align, size, and width DOM attributes of the
hr element must reflect the respective
content attributes of the same name.
The noShade DOM
attribute of the hr element must reflect
the element's noshade
content attribute.
[Supplemental] interface HTMLHtmlElement { attribute DOMString version; };
The version DOM
attribute of the html element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLIFrameElement { attribute DOMString align; attribute DOMString frameBorder; attribute DOMString longDesc; attribute DOMString marginHeight; attribute DOMString marginWidth; attribute DOMString scrolling; };
The name and
scrolling DOM
attributes of the iframe element must
reflect the respective content attributes of the same
name.
The frameBorder DOM
attribute of the iframe element must
reflect the element's iframeborder content
attribute.
The longDesc
DOM attribute of the iframe element must
reflect the element's longdesc content attribute.
The marginHeight DOM
attribute of the iframe element must
reflect the element's marginheight content
attribute.
The marginWidth DOM
attribute of the iframe element must
reflect the element's marginwidth content
attribute.
[Supplemental] interface HTMLImageElement { attribute DOMString name; attribute DOMString align; attribute DOMString border; attribute long hspace; attribute DOMString longDesc; attribute long vspace; };
The name, align, border, hspace, and vspace DOM attributes of
the img element must reflect the
respective content attributes of the same name.
The longDesc DOM
attribute of the img element must reflect
the element's longdesc content
attribute.
[Supplemental] interface HTMLInputElement { attribute DOMString align; attribute DOMString useMap; };
The align DOM
attribute of the input element must reflect
the content attribute of the same name.
The useMap DOM
attribute of the input element must
reflect the element's usemap content attribute.
[Supplemental] interface HTMLLegendElement { attribute DOMString align; };
The align DOM
attribute of the legend element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLLIElement { attribute DOMString type; };
The type DOM
attribute of the li element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLLinkElement { attribute DOMString charset; attribute DOMString rev; attribute DOMString target; };
The charset,
rev, and target DOM attributes of
the link element must reflect the
respective content attributes of the same name.
[Supplemental] interface HTMLMenuElement { attribute DOMString compact; };
The compact DOM
attribute of the menu element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLMetaElement { attribute DOMString scheme; };
The scheme DOM
attribute of the meta element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLObjectElement { attribute DOMString align; attribute DOMString archive; attribute DOMString border; attribute DOMString code; attribute DOMString codeBase; attribute DOMString codeType; attribute boolean declare; attribute long hspace; attribute DOMString standby; attribute long vspace; };
The align, archive, border, code, declare, hspace, standby, and vspace DOM attributes
of the object element must reflect the
respective content attributes of the same name.
The codeBase DOM
attribute of the object element must reflect
the element's codebase content
attribute.
The codeType DOM
attribute of the object element must reflect
the element's codetype content
attribute.
[Supplemental] interface HTMLOListElement { attribute DOMString compact; attribute DOMString type; };
The compact and
type DOM attributes of
the ol element must reflect the respective
content attributes of the same name.
[Supplemental] interface HTMLParagraphElement { attribute DOMString align; };
The align DOM
attribute of the p element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLParamElement { attribute DOMString type; attribute DOMString valueType; };
The type DOM
attribute of the param element must
reflect the content attribute of the same name.
The valueType
DOM attribute of the param element must
reflect the element's valuetype content attribute.
[Supplemental] interface HTMLPreElement { attribute long width; };
The width DOM
attribute of the pre element must reflect
the content attribute of the same name.
[Supplemental] interface HTMLScriptElement { attribute DOMString event; attribute DOMString htmlFor; };
The event and
htmlFor DOM
attributes of the script element must return the empty
string on getting, and do nothing on setting.
[Supplemental] interface HTMLTableElement { attribute DOMString align; attribute DOMString bgColor; attribute DOMString border; attribute DOMString cellPadding; attribute DOMString cellSpacing; attribute DOMString frame; attribute DOMString rules; attribute DOMString summary; attribute DOMString width; };
The align, border, frame, rules, summary, and width, DOM attributes of
the table element must reflect the
respective content attributes of the same name.
The bgColor DOM
attribute of the table element must reflect
the element's bgcolor content
attribute.
The cellPadding DOM
attribute of the table element must reflect
the element's cellpadding content
attribute.
The cellSpacing DOM
attribute of the table element must reflect
the element's cellspacing content
attribute.
[Supplemental] interface HTMLTableSectionElement { attribute DOMString align; attribute DOMString ch; attribute DOMString chOff; attribute DOMString vAlign; };
The align and
ch DOM attributes of
the tbody, thead, and tfoot
elements must reflect the respective content attributes
of the same name.
The chOff DOM
attribute of the tbody, thead, and
tfoot elements must reflect the elements'
choff content attributes.
The vAlign DOM
attribute of the tbody, thead, and
tfoot element must reflect the elements'
valign content
attributes.
[Supplemental] interface HTMLTableCellElement { attribute DOMString abbr; attribute DOMString align; attribute DOMString axis; attribute DOMString bgColor; attribute DOMString ch; attribute DOMString chOff; attribute DOMString height; attribute boolean noWrap; attribute DOMString vAlign; attribute DOMString width; };
The abbr, align, axis, ch, height, and width DOM attributes of
the td and th elements must
reflect the respective content attributes of the same
name.
The bgColor DOM
attribute of the td and th elements must
reflect the elements' bgcolor content attributes.
The chOff DOM
attribute of the td and th elements must
reflect the elements' choff content attributes.
The noWrap DOM
attribute of the td and th elements must
reflect the elements' nowrap content attributes.
The vAlign DOM
attribute of the td and th element must
reflect the elements' valign content attributes.
[Supplemental] interface HTMLTableRowElement { attribute DOMString align; attribute DOMString bgColor; attribute DOMString ch; attribute DOMString chOff; attribute DOMString vAlign; };
The align and ch DOM attributes of the
tr element must reflect the respective
content attributes of the same name.
The bgColor DOM
attribute of the tr element must reflect
the element's bgcolor content
attribute.
The chOff DOM
attribute of the tr element must reflect
the element's choff content
attribute.
The vAlign DOM
attribute of the tr element must reflect
the element's valign content
attribute.
[Supplemental] interface HTMLUListElement { attribute DOMString compact; attribute DOMString type; };
The compact and
type DOM attributes of
the ul element must reflect the respective
content attributes of the same name.
[Supplemental] interface HTMLDocument { attribute DOMString fgColor; attribute DOMString bgColor; attribute DOMString linkColor; attribute DOMString vlinkColor; attribute DOMString alinkColor; readonly attribute HTMLCollection anchors; readonly attribute HTMLCollection applets; readonly attribute HTMLCollection all; };
The fgColor
attribute on the Document object must
reflect the text
attribute on the body element.
The bgColor
attribute on the Document object must
reflect the bgcolor
attribute on the body element.
The linkColor
attribute on the Document object must
reflect the link
attribute on the body element.
The vLinkColor
attribute on the Document object must
reflect the vlink
attribute on the body element.
The aLinkColor
attribute on the Document object must
reflect the alink
attribute on the body element.
For the above attributes, when there is no body element, the attributes must instead return the empty string on getting and do nothing on setting.
The anchors
attribute must return an HTMLCollection rooted at the
Document node, whose filter matches only a
elements with name
attributes.
The applets
attribute must return an HTMLCollection rooted at the
Document node, whose filter matches only
applet elements.
The all
attribute must return an HTMLCollection rooted at the
Document node, whose filter matches all elements.
The user agent must act as if the ToBoolean() operator in
JavaScript converted the object returned for all to the false value.
This is a willful violation of the JavaScript specification current at the time of writing (ECMAScript edition 3). The JavaScript specification requires that the ToBoolean() operator convert all objects to the true value. This violation is motivated by a desire for compatibility with legacy content. [ECMA262]
To ease the transition from HTML4 Transitional documents to the language defined in this specification, conformance checkers are encouraged to categorize errors that represent usage of old obsolete features that generally have no effect (as defined below) into a separate part of their report, to allow authors to distinguish between likely mistakes and mere vestigial markup.
The following errors may be categorized as described above:
The DOCTYPE parse error, if the DOCTYPE token's
name is an ASCII
case-insensitive match for the string "HTML", and either:
-//W3C//DTD HTML 4.0//EN" and the
token's system identifier is either missing or the
case-sensitive string "http://www.w3.org/TR/REC-html40/strict.dtd", or-//W3C//DTD HTML 4.01//EN" and the
token's system identifier is either missing or the
case-sensitive string "http://www.w3.org/TR/html4/strict.dtd", or-//W3C//DTD XHTML 1.0 Strict//EN"
and the token's system identifier is the
case-sensitive string "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd",
or-//W3C//DTD XHTML 1.1//EN"
and the token's system identifier is the
case-sensitive string "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd".The presence of a profile attribute on the
head element, if its value is an unordered set
of unique space-separated tokens where the words are all
valid URLs.
The presence of a meta element with an http-equiv attribute in the
Content
Language state.
The presence of a border attribute on an
img element if its value is the string "0".
The presence of a longdesc attribute on an
img element, if its value is a valid
URL.
The presence of a language attribute on a
script element if its value is an ASCII
case-insensitive match for the string "JavaScript".
The presence of a name
attribute on an a element, if its value is not the
empty string.