Document Object Model HTML
- Editors:
- Johnny Stenback, Netscape
- Philippe Le Hégaret, W3C
- Arnaud Le Hors, W3C and IBM (until November 2000)
Table of contents
- 1.1. Introduction
- 1.2. HTML Application of Core DOM
- 1.3. XHTML and the HTML DOM
- 1.4. Miscellaneous Object Definitions
- 1.5. Objects related to HTML documents
- 1.6.
HTML Elements
- 1.6.1. Property Attributes
- 1.6.2. Naming Exceptions
- 1.6.3. Exposing Element Type Names (tagName, (nodeName))
- 1.6.4. The HTMLElement interface
- 1.6.5.
Object definitions
- HTMLHtmlElement, HTMLHeadElement, HTMLLinkElement, HTMLTitleElement, HTMLMetaElement, HTMLBaseElement, HTMLIsIndexElement, HTMLStyleElement, HTMLBodyElement, HTMLFormElement, HTMLSelectElement, HTMLOptGroupElement, HTMLOptionElement, HTMLInputElement, HTMLTextAreaElement, HTMLButtonElement, HTMLLabelElement, HTMLFieldSetElement, HTMLLegendElement, HTMLUListElement, HTMLOListElement, HTMLDListElement, HTMLDirectoryElement, HTMLMenuElement, HTMLLIElement, HTMLDivElement, HTMLParagraphElement, HTMLHeadingElement, HTMLQuoteElement, HTMLPreElement, HTMLBRElement, HTMLBaseFontElement, HTMLFontElement, HTMLHRElement, HTMLModElement, HTMLAnchorElement, HTMLImageElement, HTMLObjectElement, HTMLParamElement, HTMLAppletElement, HTMLMapElement, HTMLAreaElement, HTMLScriptElement, HTMLTableElement, HTMLTableCaptionElement, HTMLTableColElement, HTMLTableSectionElement, HTMLTableRowElement, HTMLTableCellElement, HTMLFrameSetElement, HTMLFrameElement, HTMLIFrameElement
1.1. Introduction
This section extends the DOM Level 2 Core API [DOM Level 2 Core] to describe objects and methods specific to HTML documents [HTML 4.01], and XHTML documents [XHTML 1.0]. In general, the functionality needed to manipulate hierarchical document structures, elements, and attributes will be found in the core section; functionality that depends on the specific elements defined in HTML will be found in this section.
The goals of the HTML-specific DOM API are:
- to specialize and add functionality that relates specifically to HTML documents and elements.
- to address issues of backwards compatibility with the DOM Level 0.
- to provide convenience mechanisms, where appropriate, for common and frequent operations on HTML documents.
The key differences between the core DOM and the HTML application of DOM is that the HTML Document Object Model exposes a number of convenience methods and properties that are consistent with the existing models and are more appropriate to script writers. In many cases, these enhancements are not applicable to a general DOM because they rely on the presence of a predefined DTD. The transitional or frameset DTD for HTML 4.01, or the XHTML 1.0 DTDs are assumed. Interoperability between implementations is only guaranteed for elements and attributes that are specified in the HTML 4.01 and XHTML 1.0 DTDs.
More specifically, this document includes the following specializations for HTML:
- An
HTMLDocumentinterface, derived from the coreDocumentinterface.HTMLDocumentspecifies the operations and queries that can be made on a HTML document. - An
HTMLElementinterface, derived from the coreElementinterface.HTMLElementspecifies the operations and queries that can be made on any HTML element. Methods onHTMLElementinclude those that allow for the retrieval and modification of attributes that apply to all HTML elements. - Specializations for all HTML elements that have attributes that
extend beyond those specified in the
HTMLElementinterface. For all such attributes, the derived interface for the element contains explicit methods for setting and getting the values.
The DOM Level 2 includes mechanisms to access and modify style specified through CSS and defines an event model that can be used with HTML documents.
The interfaces found within this section are not mandatory. A
DOM application may use the hasFeature(feature,
version) method of the DOMImplementation
interface with parameter values "HTML" and "2.0" (respectively) to
determine whether or not this module is supported by the
implementation. In addition to the feature string "HTML", the
feature string "XHTML" (version string "2.0") can be used to check
if the implementation supports XHTML (this is equivalent to
checking the features "XML" and "HTML"). In order to fully support
this module, an implementation must also support the "Core" feature
defined [DOM Level 2 Core]. Please refer
to additional information about
conformance in the DOM Level 2 Core specification [DOM Level 2
Core].
A DOM application can use the hasFeature method of
the DOMImplementation interface to determine whether
they are supported or not. The feature string for all the
interfaces listed in this section is "HTML" and the version is
"2.0". In order to fully support this feature, an implementation
needs also to support the "Core" feature defined in the Document
Object Model Level 2 Core [DOM Level 2 Core] (see also
Conformance).
The interfaces in this specification are designed for [HTML 4.01] documents, as well as for [XHTML 1.0] documents.
Note: This specification does not intend to define
exactly how a user agent will respond to a change to any attribute
on an element that directly or indirectly references external data,
such elements are HTMLAppletElement, HTMLFrameElement, HTMLFrameSetElement,
HTMLIFrameElement,
HTMLImageElement,
HTMLLinkElement,
HTMLObjectElement,
HTMLParamElement,
and HTMLScriptElement.
1.2. HTML Application of Core DOM
1.2.1. Naming Conventions
The HTML DOM follows a naming convention for properties, methods, events, collections, and data types. All names are defined as one or more English words concatenated together to form a single string.
1.2.1.1. Properties and Methods
The property or method name starts with the initial keyword in lowercase, and each subsequent word starts with a capital letter. For example, a property that returns document meta information such as the date the file was created might be named "fileDateCreated". In the ECMAScript binding, properties are exposed as properties of a given object. In Java, properties are exposed with get and set methods.
1.2.1.2. Non-HTML 4.0 interfaces and attributes
While most of the interfaces defined below can be mapped directly to elements defined in the HTML 4.01 Recommendation, some of them cannot. Similarly, not all attributes listed below have counterparts in the HTML 4.01 specification (and some do, but have been renamed to avoid conflicts with scripting languages). Interfaces and attribute definitions that have links to the HTML 4.0 specification have corresponding element and attribute definitions there; all others are added by this specification, either for convenience or backwards compatibility with DOM Level 0 implementations.
1.3. XHTML and the HTML DOM
The DOM HTML Level 1 API [DOM Level 1] were originally intended to be used only for HTML 4.01 documents [HTML 4.01]. The APIs were defined well before XHTML 1.0 [XHTML 1.0] became a specification, or before it was worked on by the HTML Working Group.
From the DOM point of view, The biggest difference between HTML 4.01 (and earlier) and XHTML 1.0 is that XHTML is case sensitive, whereas HTML 4.01 is case insensitive. The HTML case insensitivity is also reflected in the DOM HTML API. For instance, element and attribute names are exposed as all uppercase (for consistency) when used on an HTML document, regardless of the character case used in the markup. Since XHTML is based on XML, in XHTML everything is case sensitive, and element and attribute names must be lowercase in the markup.
Developers need to take two things into account when writing
code that works on both HTML and XHTML documents. When comparing
element or attribute names to strings, the string compare needs to
be case insensitive, or the element or attribute name needs to be
converted into lowercase before comparing against a lowercase
string. Second, when calling methods that are case insensitive when
used on a HTML document (such as
getElementsByTagName() and namedItem()),
the string that is passed in should be lowercase.
Note: The interfaces provided in this document are only for [HTML 4.01] and [XHTML 1.0] documents and are not guaranteed to work with any future version of XHTML.
1.4. Miscellaneous Object Definitions
- Interface HTMLCollection
-
An
HTMLCollectionis a list of nodes. An individual node may be accessed by either ordinal index or the node'snameoridattributes.Note: Collections in the HTML DOM are assumed to be live meaning that they are automatically updated when the underlying document is changed.
IDL Definition-
- Attributes
-
lengthof typeunsigned long, readonly- This attribute specifies the length or size of the
list.
- Methods
-
item-
This method retrieves a node specified by ordinal index. Nodes are numbered in tree order (depth-first traversal order).
Parameters
indexof typeunsigned long- The index of the node to be fetched. The index origin is
0.
Return Value
NodeThe
Nodeat the corresponding position upon success. A value ofnullis returned if the index is out of range.No Exceptions
namedItem-
This method retrieves a
Nodeusing a name. With [HTML 4.01] documents, it first searches for aNodewith a matchingidattribute. If it doesn't find one, it then searches for aNodewith a matchingnameattribute, but only on those elements that are allowed a name attribute. With [XHTML 1.0] documents, this method only searches forNodeswith a matchingidattribute. This method is case insensitive in HTML documents and case sensitive in XHTML documents.Parameters
nameof typeDOMString- The name of the
Nodeto be fetched.
Return Value
NodeThe
Nodewith anameoridattribute whose value corresponds to the specified string. Upon failure (e.g., no node with this name exists), returnsnull.No Exceptions
- Interface HTMLOptionsCollection (introduced in DOM Level 2)
-
An
HTMLOptionsCollectionis a list of nodes representing HTML option element. An individual node may be accessed by either ordinal index or the node'snameoridattributes.Note: Collections in the HTML DOM are assumed to be live meaning that they are automatically updated when the underlying document is changed.
IDL Definition-
// Introduced in DOM Level 2: interface HTMLOptionsCollection { attribute unsigned long length; // raises(DOMException) on setting Node item(in unsigned long index); Node namedItem(in DOMString name); };
- Attributes
-
lengthof typeunsigned long- This attribute specifies the length or size of the
list.
Exceptions on setting
DOMExceptionNOT_SUPPORTED_ERR: if setting the length is not allowed by the implementation.
- Methods
-
item-
This method retrieves a node specified by ordinal index. Nodes are numbered in tree order (depth-first traversal order).
Parameters
indexof typeunsigned long- The index of the node to be fetched. The index origin is
0.
Return Value
NodeThe
Nodeat the corresponding position upon success. A value ofnullis returned if the index is out of range.No Exceptions
namedItem-
This method retrieves a
Nodeusing a name. It first searches for aNodewith a matchingidattribute. If it doesn't find one, it then searches for aNodewith a matchingnameattribute, but only on those elements that are allowed a name attribute. This method is case insensitive in HTML documents and case sensitive in XHTML documents.Parameters
nameof typeDOMString- The name of the
Nodeto be fetched.
Return Value
NodeThe
Nodewith anameoridattribute whose value corresponds to the specified string. Upon failure (e.g., no node with this name exists), returnsnull.No Exceptions
1.5. Objects related to HTML documents
- Interface HTMLDocument
-
An
HTMLDocumentis the root of the HTML hierarchy and holds the entire content. Besides providing access to the hierarchy, it also provides some convenience methods for accessing certain sets of information from the document.The following properties have been deprecated in favor of the corresponding ones for the
BODYelement:- alinkColor
- background
- bgColor
- fgColor
- linkColor
- vlinkColor
Note: In DOM Level 2, the method
getElementByIdis inherited from theDocumentinterface where it was moved to.
IDL Definition-
- Attributes
-
URLof typeDOMString, readonly- The absolute URI [IETF RFC 2396] of the
document.
anchorsof typeHTMLCollection, readonly- A collection of all the anchor (
A) elements in a document with a value for thenameattribute.Note: For reasons of backward compatibility, the returned set of anchors only contains those anchors created with the
nameattribute, not those created with theidattribute. Note that in [XHTML 1.0], thenameattribute (see section 4.10) has no semantics and is only present for legacy user agents: theidattribute is used instead. Users should prefer the iterator mechanisms provided by [DOM Level 2 Traversal] instead. appletsof typeHTMLCollection, readonly- A collection of all the
OBJECTelements that include applets andAPPLET(deprecated) elements in a document.
bodyof typeHTMLElement- The element that contains the content for the document. In
documents with
BODYcontents, returns theBODYelement. In frameset documents, this returns the outermostFRAMESETelement.
cookieof typeDOMString- This mutable string attribute denotes persistent state
information that (1) is associated with the current frame or
document and (2) is composed of information described by the
cookiesnon-terminal of [IETF RFC 2965], Section 4.2.2.
If no persistent state information is available for the current frame or document document, then this property's value is an empty string.
When this attribute is read, all cookies are returned as a single string, with each cookie's name-value pair concatenated into a list of name-value pairs, each list item being separated by a ';' (semicolon).
When this attribute is set, the value it is set to should be a string that adheres to thecookienon-terminal of [IETF RFC 2965]; that is, it should be a single name-value pair followed by zero or more cookie attribute values. If no domain attribute is specified, then the domain attribute for the new value defaults to the host portion of an absolute URI [IETF RFC 2396] of the current frame or document. If no path attribute is specified, then the path attribute for the new value defaults to the absolute path portion of the URI [IETF RFC 2396] of the current frame or document. If no max-age attribute is specified, then the max-age attribute for the new value defaults to a user agent defined value. If a cookie with the specified name is already associated with the current frame or document, then the new value as well as the new attributes replace the old value and attributes. If a max-age attribute of 0 is specified for the new value, then any existing cookies of the specified name are removed from the cookie storage.Note: See [IETF RFC 2965] for the semantics of persistent state item attribute value pairs.
Note: The precise nature of a user agent session is not defined by this specification.
Exceptions on setting
DOMExceptionSYNTAX_ERR: If the new value does not adhere to the cookie syntax specified by [IETF RFC 2965].
domainof typeDOMString, readonly- The domain name of the server that served the document, or
nullif the server cannot be identified by a domain name.
formsof typeHTMLCollection, readonly- A collection of all the forms of a document.
imagesof typeHTMLCollection, readonly- A collection of all the
IMGelements in a document. The behavior is limited toIMGelements for backwards compatibility.Note: As suggested by [HTML 4.01], to include images, authors may use the
OBJECTelement or theIMGelement. Therefore, it is recommended not to use this attribute to find the images in the document butgetElementsByTagNamewith HTML 4.01 orgetElementsByTagNameNSwith XHTML 1.0. linksof typeHTMLCollection, readonly- A collection of all
AREAelements and anchor (A) elements in a document with a value for thehrefattribute.
referrerof typeDOMString, readonly- Returns the URI [IETF RFC 2396] of the page that
linked to this page. The value is an empty string if the user
navigated to the page directly (not through a link, but, for
example, via a bookmark).
titleof typeDOMString- The title of a document as specified by the
TITLEelement in the head of the document.
- Methods
-
close-
Closes a document stream opened by
open()and forces rendering.No Parameters
No Return Value
No Exceptions
getElementsByName-
With [HTML 4.01] documents, this method returns the (possibly empty) collection of elements whose
namevalue is given byelementName. In [XHTML 1.0] documents, this methods only return the (possibly empty) collection of form controls with matching name. This method is case sensitive.Parameters
elementNameof typeDOMString- The
nameattribute value for an element.
Return Value
NodeListThe matching elements.
No Exceptions
open-
Open a document stream for writing. If a document exists in the target, this method clears it.
Note: This method and the ones following allow a user to add to or replace the structure model of a document using strings of unparsed HTML. At the time of writing alternate methods for providing similar functionality for both HTML and XML documents were being considered (see [DOM Level 3 Load and Save]).
No Parameters
No Return Value
No Exceptions
write-
Write a string of text to a document stream opened by
open(). Note that the function will produce a document which is not necessarily driven by a DTD and therefore might be produce an invalid result in the context of the document.Parameters
textof typeDOMString- The string to be parsed into some structure in the document
structure model.
No Return Value
No Exceptions
writeln-
Write a string of text followed by a newline character to a document stream opened by
open(). Note that the function will produce a document which is not necessarily driven by a DTD and therefore might be produce an invalid result in the context of the documentParameters
textof typeDOMString- The string to be parsed into some structure in the document
structure model.
No Return Value
No Exceptions
1.6. HTML Elements
1.6.1. Property Attributes
HTML attributes are exposed as properties on the element object. The DOM naming conventions always determine the name of the exposed property, and are independent of the case of the attribute in the source document. The data type of the property is in general determined by the type of the attribute as determined by the HTML 4.01 (transitional and frameset) and XHTML 1.0 DTDs. The attributes have the semantics (including case-sensitivity) given in the [HTML 4.01] and [XHTML 1.0] specifications.
The attributes are exposed as properties for compatibility with
DOM Level 0.
This usage is deprecated because it can not be generalized to all
possible attribute names for XML. We recommend the use of generic
methods on the core Element interface for setting,
getting and removing attributes.
| DTD Data Type | Object Model Data Type |
|---|---|
| CDATA | DOMString |
| Value list (e.g., (left | right | center)) | DOMString |
| one-value Value list (e.g., (disabled)) | boolean |
| Number | long int |
In an HTML document the return value of an attribute that has a data type that is a value list is normalized to lowercase (independent of the case of the value in the source document).
For example, if the value of the align attribute on a P element
is "Left" (which is not a valid value in XHTML due to the case
sensitivity of XHTML) then the value is returned as "left". For
attributes with the CDATA data type, the case of the
return value is that given in the source document.
The return value of an attribute that is unspecified and does not have a default value is the empty string if the return type is a DOMString, false if the return type is a boolean and 0 if the return type is a number.
1.6.2. Naming Exceptions
To avoid namespace conflicts, two attributes with the same name
as a keyword in one of our chosen binding languages
were prefixed. The for attribute of the
LABEL and SCRIPT elements collides with
loop construct naming conventions and is renamed
htmlFor. The class attribute of the HTML
elements collides with class definitions naming conventions and is
renamed className.
1.6.3. Exposing Element Type
Names (tagName, (nodeName))
If the document is an HTML 4.01 document the element type names
exposed through a property are in uppercase. For example, the body
element type name is exposed through the tagName
property as BODY. If the document is an XHTML 1.0
document the element name is exposed as it is written in the XHTML
file. This means that the element type names are exposed in
lowercase for XHTML documents since the XHTML 1.0 DTDs defines
element type names as lowercase, and XHTML, being derived from XML,
is case sensitive.
1.6.4. The HTMLElement interface
- Interface HTMLElement
-
All HTML element interfaces derive from this class. Elements that only expose the HTML core attributes are represented by the base
HTMLElementinterface. These elements are as follows:- special: SUB, SUP, SPAN, BDO
- font: TT, I, B, U, S, STRIKE, BIG, SMALL
- phrase: EM, STRONG, DFN, CODE, SAMP, KBD, VAR, CITE, ACRONYM, ABBR
- list: DD, DT
- NOFRAMES, NOSCRIPT
- ADDRESS, CENTER
Note: The
styleattribute of an HTML element is accessible through theElementCSSInlineStyleinterface which is defined in the CSS module [DOM Level 2 Style Sheets and CSS].
IDL Definition-
- Attributes
-
classNameof typeDOMString- The class attribute of the element. This attribute has been
renamed due to conflicts with the "class" keyword exposed by many
languages. See the
class attribute definition in HTML 4.01.
dirof typeDOMString- Specifies the base direction of directionally neutral text and
the directionality of tables. See the
dir attribute definition in HTML 4.01.
idof typeDOMString- The element's identifier. See the
id attribute definition in HTML 4.01.
langof typeDOMString- Language code defined in RFC 1766. See the
lang attribute definition in HTML 4.01.
titleof typeDOMString- The element's advisory title. See the
title attribute definition in HTML 4.01.
1.6.5. Object definitions
- Interface HTMLHtmlElement
-
Root of an HTML document. See the HTML element definition in HTML 4.01.
IDL Definition-
- Attributes
-
versionof typeDOMString- Version information about the document's DTD. See the
version attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLHeadElement
-
Document head information. See the HEAD element definition in HTML 4.01.
IDL Definition-
- Attributes
-
profileof typeDOMString- URI [IETF RFC 2396] designating a
metadata profile. See the
profile attribute definition in HTML 4.01.
- Interface HTMLLinkElement
-
The
LINKelement specifies a link to an external resource, and defines this document's relationship to that resource (or vice versa). See the LINK element definition in HTML 4.01 (see also theLinkStyleinterface in the StyleSheet module [DOM Level 2 Style Sheets and CSS]).
IDL Definition-
- Attributes
-
charsetof typeDOMString- The character encoding of the resource being linked to. See the
charset attribute definition in HTML 4.01.
disabledof typeboolean- Enables/disables the link. This is currently only used for
style sheet links, and may be used to activate or deactivate style
sheets.
hrefof typeDOMString- The URI [IETF RFC 2396] of the linked
resource. See the
href attribute definition in HTML 4.01.
hreflangof typeDOMString- Language code of the linked resource. See the
hreflang attribute definition in HTML 4.01.
mediaof typeDOMString- Designed for use with one or more target media. See the
media attribute definition in HTML 4.01.
relof typeDOMString- Forward link type. See the
rel attribute definition in HTML 4.01.
revof typeDOMString- Reverse link type. See the
rev attribute definition in HTML 4.01.
targetof typeDOMString- Frame to render the resource in. See the
target attribute definition in HTML 4.01.
typeof typeDOMString- Advisory content type. See the
type attribute definition in HTML 4.01.
- Interface HTMLTitleElement
-
The document title. See the TITLE element definition in HTML 4.01.
IDL Definition-
- Attributes
-
textof typeDOMString- The specified title as a string.
- Interface HTMLMetaElement
-
This contains generic meta-information about the document. See the META element definition in HTML 4.01.
IDL Definition-
- Attributes
-
contentof typeDOMString- Associated information. See the
content attribute definition in HTML 4.01.
httpEquivof typeDOMString- HTTP response header name [IETF RFC 2616]. See the
http-equiv attribute definition in HTML 4.01.
nameof typeDOMString- Meta information name. See the
name attribute definition in HTML 4.01.
schemeof typeDOMString- Select form of content. See the
scheme attribute definition in HTML 4.01.
- Interface HTMLBaseElement
-
Document base URI [IETF RFC 2396]. See the BASE element definition in HTML 4.01.
IDL Definition-
- Attributes
-
hrefof typeDOMString- The base URI [IETF RFC 2396]. See the
href attribute definition in HTML 4.01.
targetof typeDOMString- The default target frame. See the
target attribute definition in HTML 4.01.
- Interface HTMLIsIndexElement
-
This element is used for single-line text input. See the ISINDEX element definition in HTML 4.01. This element is deprecated in HTML 4.01.
IDL Definition-
- Attributes
-
formof typeHTMLFormElement, readonly- Returns the
FORMelement containing this control. Returnsnullif this control is not within the context of a form.
promptof typeDOMString- The prompt message. See the
prompt attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLStyleElement
-
Style information. See the STYLE element definition in HTML 4.01, the CSS module [DOM Level 2 Style Sheets and CSS] and the
LinkStyleinterface in the StyleSheets module [DOM Level 2 Style Sheets and CSS].
IDL Definition-
- Attributes
-
disabledof typeboolean- Enables/disables the style sheet.
mediaof typeDOMString- Designed for use with one or more target media. See the
media attribute definition in HTML 4.01.
typeof typeDOMString- The content type of the style sheet language. See the
type attribute definition in HTML 4.01.
- Interface HTMLBodyElement
-
The HTML document body. This element is always present in the DOM API, even if the tags are not present in the source document. See the BODY element definition in HTML 4.01.
IDL Definition-
- Attributes
-
aLinkof typeDOMString- Color of active links (after mouse-button down, but before
mouse-button up). See the
alink attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
backgroundof typeDOMString- URI [IETF RFC 2396] of the background
texture tile image. See the
background attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
bgColorof typeDOMString- Document background color. See the
bgcolor attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
linkof typeDOMString- Color of links that are not active and unvisited. See the
link attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
textof typeDOMString- Document text color. See the
text attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
vLinkof typeDOMString- Color of links that have been visited by the user. See the
vlink attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLFormElement
-
The
FORMelement encompasses behavior similar to a collection and an element. It provides direct access to the contained form controls as well as the attributes of the form element. See the FORM element definition in HTML 4.01.
IDL Definition-
- Attributes
-
acceptCharsetof typeDOMString- List of character sets supported by the server. See the
accept-charset attribute definition in HTML 4.01.
actionof typeDOMString- Server-side form handler. See the
action attribute definition in HTML 4.01.
elementsof typeHTMLCollection, readonly- Returns a collection of all form control elements in the
form.
enctypeof typeDOMString- The content type of the submitted form, generally
"application/x-www-form-urlencoded". See the
enctype attribute definition in HTML 4.01.
Note: The onsubmit even handler is not guaranteed to be triggered when invoking this method. The behavior is inconsistent for historical reasons and authors should not rely on a particular one.
lengthof typelong, readonly- The number of form controls in the form.
methodof typeDOMString- HTTP method [IETF RFC 2616] used to submit
form. See the
method attribute definition in HTML 4.01.
nameof typeDOMString- Names the form.
targetof typeDOMString- Frame to render the resource in. See the
target attribute definition in HTML 4.01.
- Methods
- Interface HTMLSelectElement
-
The select element allows the selection of an option. The contained options can be directly accessed through the select element as a collection. See the SELECT element definition in HTML 4.01.
IDL Definition-
- Attributes
-
disabledof typeboolean- The control is unavailable in this context. See the
disabled attribute definition in HTML 4.01.
formof typeHTMLFormElement, readonly- Returns the
FORMelement containing this control. Returnsnullif this control is not within the context of a form.
lengthof typeunsigned long, modified in DOM Level 2- The number of options in this
SELECT.
Exceptions on setting
DOMExceptionNOT_SUPPORTED_ERR: if setting the length is not allowed by the implementation.
multipleof typeboolean- If true, multiple
OPTIONelements may be selected in thisSELECT. See the multiple attribute definition in HTML 4.01.
nameof typeDOMString- Form control or object name when submitted with a form. See the
name attribute definition in HTML 4.01.
optionsof typeHTMLOptionsCollection, readonly, modified in DOM Level 2- The collection of
OPTIONelements contained by this element.
selectedIndexof typelong- The ordinal index of the selected option, starting from 0. The
value -1 is returned if no element is selected. If multiple options
are selected, the index of the first selected option is
returned.
sizeof typelong- Number of visible rows. See the
size attribute definition in HTML 4.01.
tabIndexof typelong- Index that represents the element's position in the tabbing
order. See the
tabindex attribute definition in HTML 4.01.
typeof typeDOMString, readonly- The type of this form control. This is the string
"select-multiple" when the multiple attribute is
trueand the string "select-one" whenfalse.
valueof typeDOMString- The current form control value (i.e. the value of the currently
selected option), if multiple options are selected this is the
value of the first selected option.
- Methods
-
add-
Add a new element to the collection of
OPTIONelements for thisSELECT. This method is the equivalent of theappendChildmethod of theNodeinterface if thebeforeparameter isnull. It is equivalent to theinsertBeforemethod on the parent ofbeforein all other cases. This method may have no effect if the new element is not anOPTIONor anOPTGROUP.Parameters
elementof typeHTMLElement- The element to add.
beforeof typeHTMLElement- The element to insert before, or
nullfor the tail of the list.
Exceptions
DOMExceptionNOT_FOUND_ERR: Raised if
beforeis not a descendant of theSELECTelement.No Return Value
blur-
Removes keyboard focus from this element.
No Parameters
No Return Value
No Exceptions
focus-
Gives keyboard focus to this element.
No Parameters
No Return Value
No Exceptions
remove-
Remove an element from the collection of
OPTIONelements for thisSELECT. Does nothing if no element has the given index.Parameters
indexof typelong- The index of the item to remove, starting from 0.
No Return Value
No Exceptions
- Interface HTMLOptGroupElement
-
Group options together in logical subdivisions. See the OPTGROUP element definition in HTML 4.01.
IDL Definition-
- Attributes
-
disabledof typeboolean- The control is unavailable in this context. See the
disabled attribute definition in HTML 4.01.
labelof typeDOMString- Assigns a label to this option group. See the
label attribute definition in HTML 4.01.
- Interface HTMLOptionElement
-
A selectable choice. See the OPTION element definition in HTML 4.01.
IDL Definition-
- Attributes
-
defaultSelectedof typeboolean, modified in DOM Level 2- Represents the value of the HTML selected attribute. The value
of this attribute does not change if the state of the corresponding
form control, in an interactive user agent, changes. See the
selected attribute definition in HTML 4.01.
disabledof typeboolean- The control is unavailable in this context. See the
disabled attribute definition in HTML 4.01.
formof typeHTMLFormElement, readonly- Returns the
FORMelement containing this control. Returnsnullif this control is not within the context of a form.
indexof typelong, readonly, modified in DOM Level 2- The index of this
OPTIONin its parentSELECT, starting from 0.
labelof typeDOMString- Option label for use in hierarchical menus. See the
label attribute definition in HTML 4.01.
selectedof typeboolean- Represents the current state of the corresponding form control,
in an interactive user agent. Changing this attribute changes the
state of the form control, but does not change the value of the
HTML selected attribute of the element.
textof typeDOMString, readonly- The text contained within the option element.
valueof typeDOMString- The current form control value. See the
value attribute definition in HTML 4.01.
- Interface HTMLInputElement
-
Form control.
Note: Depending upon the environment in which the page is being viewed, the value property may be read-only for the file upload input type. For the "password" input type, the actual value returned may be masked to prevent unauthorized use. See the INPUT element definition in [HTML 4.01].
IDL Definition-
- Attributes
-
acceptof typeDOMString- A comma-separated list of content types that a server
processing this form will handle correctly. See the
accept attribute definition in HTML 4.01.
accessKeyof typeDOMString- A single character access key to give access to the form
control. See the
accesskey attribute definition in HTML 4.01.
alignof typeDOMString- Aligns this object (vertically or horizontally) with respect to
its surrounding text. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
altof typeDOMString- Alternate text for user agents not rendering the normal content
of this element. See the
alt attribute definition in HTML 4.01.
checkedof typeboolean- When the
typeattribute of the element has the value "radio" or "checkbox", this represents the current state of the form control, in an interactive user agent. Changes to this attribute change the state of the form control, but do not change the value of the HTML checked attribute of the INPUT element.Note: During the handling of a click event on an input element with a type attribute that has the value "radio" or "checkbox", some implementations may change the value of this property before the event is being dispatched in the document. If the default action of the event is canceled, the value of the property may be changed back to its original value. This means that the value of this property during the handling of click events is implementation dependent.
defaultCheckedof typeboolean- When
typehas the value "radio" or "checkbox", this represents the HTML checked attribute of the element. The value of this attribute does not change if the state of the corresponding form control, in an interactive user agent, changes. See the checked attribute definition in HTML 4.01.
defaultValueof typeDOMString- When the
typeattribute of the element has the value "text", "file" or "password", this represents the HTML value attribute of the element. The value of this attribute does not change if the contents of the corresponding form control, in an interactive user agent, changes. See the value attribute definition in HTML 4.01.
disabledof typeboolean- The control is unavailable in this context. See the
disabled attribute definition in HTML 4.01.
formof typeHTMLFormElement, readonly- Returns the
FORMelement containing this control. Returnsnullif this control is not within the context of a form.
maxLengthof typelong- Maximum number of characters for text fields, when
typehas the value "text" or "password". See the maxlength attribute definition in HTML 4.01.
nameof typeDOMString- Form control or object name when submitted with a form. See the
name attribute definition in HTML 4.01.
readOnlyof typeboolean- This control is read-only. Relevant only when
typehas the value "text" or "password". See the readonly attribute definition in HTML 4.01.
sizeof typeunsigned long, modified in DOM Level 2- Size information. The precise meaning is specific to each type
of field. See the
size attribute definition in HTML 4.01.
srcof typeDOMString- When the
typeattribute has the value "image", this attribute specifies the location of the image to be used to decorate the graphical submit button. See the src attribute definition in HTML 4.01.
tabIndexof typelong- Index that represents the element's position in the tabbing
order. See the
tabindex attribute definition in HTML 4.01.
typeof typeDOMString, modified in DOM Level 2- The type of control created (all lower case). See the
type attribute definition in HTML 4.01.
useMapof typeDOMString- Use client-side image map. See the
usemap attribute definition in HTML 4.01.
valueof typeDOMString- When the
typeattribute of the element has the value "text", "file" or "password", this represents the current contents of the corresponding form control, in an interactive user agent. Changing this attribute changes the contents of the form control, but does not change the value of the HTML value attribute of the element. When thetypeattribute of the element has the value "button", "hidden", "submit", "reset", "image", "checkbox" or "radio", this represents the HTML value attribute of the element. See the value attribute definition in HTML 4.01.
- Methods
-
blur-
Removes keyboard focus from this element.
No Parameters
No Return Value
No Exceptions
click-
Simulate a mouse-click. For
INPUTelements whosetypeattribute has one of the following values: "button", "checkbox", "radio", "reset", or "submit".No Parameters
No Return Value
No Exceptions
focus-
Gives keyboard focus to this element.
No Parameters
No Return Value
No Exceptions
select-
Select the contents of the text area. For
INPUTelements whosetypeattribute has one of the following values: "text", "file", or "password".No Parameters
No Return Value
No Exceptions
- Interface HTMLTextAreaElement
-
Multi-line text field. See the TEXTAREA element definition in HTML 4.01.
IDL Definition-
- Attributes
-
accessKeyof typeDOMString- A single character access key to give access to the form
control. See the
accesskey attribute definition in HTML 4.01.
colsof typelong- Width of control (in characters). See the
cols attribute definition in HTML 4.01.
defaultValueof typeDOMString, modified in DOM Level 2- Represents the contents of the element. The value of this
attribute does not change if the contents of the corresponding form
control, in an interactive user agent, changes.
disabledof typeboolean- The control is unavailable in this context. See the
disabled attribute definition in HTML 4.01.
formof typeHTMLFormElement, readonly- Returns the
FORMelement containing this control. Returnsnullif this control is not within the context of a form.
nameof typeDOMString- Form control or object name when submitted with a form. See the
name attribute definition in HTML 4.01.
readOnlyof typeboolean- This control is read-only. See the
readonly attribute definition in HTML 4.01.
rowsof typelong- Number of text rows. See the
rows attribute definition in HTML 4.01.
tabIndexof typelong- Index that represents the element's position in the tabbing
order. See the
tabindex attribute definition in HTML 4.01.
typeof typeDOMString, readonly- The type of this form control. This the string
"textarea".
valueof typeDOMString- Represents the current contents of the corresponding form
control, in an interactive user agent. Changing this attribute
changes the contents of the form control, but does not change the
contents of the element. If the entirety of the data can not fit
into a single
DOMString, the implementation may truncate the data.
- Methods
- Interface HTMLButtonElement
-
Push button. See the BUTTON element definition in HTML 4.01.
IDL Definition-
- Attributes
-
accessKeyof typeDOMString- A single character access key to give access to the form
control. See the
accesskey attribute definition in HTML 4.01.
disabledof typeboolean- The control is unavailable in this context. See the
disabled attribute definition in HTML 4.01.
formof typeHTMLFormElement, readonly- Returns the
FORMelement containing this control. Returnsnullif this control is not within the context of a form.
nameof typeDOMString- Form control or object name when submitted with a form. See the
name attribute definition in HTML 4.01.
tabIndexof typelong- Index that represents the element's position in the tabbing
order. See the
tabindex attribute definition in HTML 4.01.
typeof typeDOMString, readonly- The type of button (all lower case). See the
type attribute definition in HTML 4.01.
valueof typeDOMString- The current form control value. See the
value attribute definition in HTML 4.01.
- Interface HTMLLabelElement
-
Form field label text. See the LABEL element definition in HTML 4.01.
IDL Definition-
- Attributes
-
accessKeyof typeDOMString- A single character access key to give access to the form
control. See the
accesskey attribute definition in HTML 4.01.
formof typeHTMLFormElement, readonly- Returns the
FORMelement containing this control. Returnsnullif this control is not within the context of a form.
htmlForof typeDOMString- This attribute links this label with another form control by
idattribute. See the for attribute definition in HTML 4.01.
- Interface HTMLFieldSetElement
-
Organizes form controls into logical groups. See the FIELDSET element definition in HTML 4.01.
IDL Definition-
- Attributes
-
formof typeHTMLFormElement, readonly- Returns the
FORMelement containing this control. Returnsnullif this control is not within the context of a form.
- Interface HTMLLegendElement
-
Provides a caption for a
FIELDSETgrouping. See the LEGEND element definition in HTML 4.01.
IDL Definition-
- Attributes
-
accessKeyof typeDOMString- A single character access key to give access to the form
control. See the
accesskey attribute definition in HTML 4.01.
alignof typeDOMString- Text alignment relative to
FIELDSET. See the align attribute definition in HTML 4.01. This attribute is deprecated in HTML 4.01.
formof typeHTMLFormElement, readonly- Returns the
FORMelement containing this control. Returnsnullif this control is not within the context of a form.
- Interface HTMLUListElement
-
Unordered list. See the UL element definition in HTML 4.01.
IDL Definition-
- Attributes
-
compactof typeboolean- Reduce spacing between list items. See the
compact attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
typeof typeDOMString- Bullet style. See the
type attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLOListElement
-
Ordered list. See the OL element definition in HTML 4.01.
IDL Definition-
- Attributes
-
compactof typeboolean- Reduce spacing between list items. See the
compact attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
startof typelong- Starting sequence number. See the
start attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
typeof typeDOMString- Numbering style. See the
type attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLDListElement
-
Definition list. See the DL element definition in HTML 4.01.
IDL Definition-
- Attributes
-
compactof typeboolean- Reduce spacing between list items. See the
compact attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLDirectoryElement
-
Directory list. See the DIR element definition in HTML 4.01. This element is deprecated in HTML 4.01.
IDL Definition-
- Attributes
-
compactof typeboolean- Reduce spacing between list items. See the
compact attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLMenuElement
-
Menu list. See the MENU element definition in HTML 4.01. This element is deprecated in HTML 4.01.
IDL Definition-
- Attributes
-
compactof typeboolean- Reduce spacing between list items. See the
compact attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLLIElement
-
List item. See the LI element definition in HTML 4.01.
IDL Definition-
- Attributes
-
typeof typeDOMString- List item bullet style. See the
type attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
valueof typelong- Reset sequence number when used in
OL. See the value attribute definition in HTML 4.01. This attribute is deprecated in HTML 4.01.
- Interface HTMLDivElement
-
Generic block container. See the DIV element definition in HTML 4.01.
IDL Definition-
- Attributes
-
alignof typeDOMString- Horizontal text alignment. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLParagraphElement
-
Paragraphs. See the P element definition in HTML 4.01.
IDL Definition-
- Attributes
-
alignof typeDOMString- Horizontal text alignment. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLHeadingElement
-
For the
H1toH6elements. See the H1 element definition in HTML 4.01.
IDL Definition-
- Attributes
-
alignof typeDOMString- Horizontal text alignment. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLQuoteElement
-
For the
QandBLOCKQUOTEelements. See the Q element definition in HTML 4.01.
IDL Definition-
- Attributes
-
citeof typeDOMString- A URI [IETF RFC 2396] designating a
source document or message. See the
cite attribute definition in HTML 4.01.
- Interface HTMLPreElement
-
Preformatted text. See the PRE element definition in HTML 4.01.
IDL Definition-
- Attributes
-
widthof typelong- Fixed width for content. See the
width attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLBRElement
-
Force a line break. See the BR element definition in HTML 4.01.
IDL Definition-
- Attributes
-
clearof typeDOMString- Control flow of text around floats. See the
clear attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLBaseFontElement
-
Base font. See the BASEFONT element definition in HTML 4.01. This element is deprecated in HTML 4.01.
IDL Definition-
- Attributes
-
colorof typeDOMString- Font color. See the color
attribute definition in HTML 4.01. This attribute is deprecated
in HTML 4.01.
faceof typeDOMString- Font face identifier. See the face
attribute definition in HTML 4.01. This attribute is deprecated
in HTML 4.01.
sizeof typelong, modified in DOM Level 2- Computed font size. See the
size attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLFontElement
-
Local change to font. See the FONT element definition in HTML 4.01. This element is deprecated in HTML 4.01.
IDL Definition-
- Attributes
-
colorof typeDOMString- Font color. See the
color attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
faceof typeDOMString- Font face identifier. See the
face attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
sizeof typeDOMString- Font size. See the
size attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLHRElement
-
Create a horizontal rule. See the HR element definition in HTML 4.01.
IDL Definition-
- Attributes
-
alignof typeDOMString- Align the rule on the page. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
noShadeof typeboolean- Indicates to the user agent that there should be no shading in
the rendering of this element. See the
noshade attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
sizeof typeDOMString- The height of the rule. See the
size attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
widthof typeDOMString- The width of the rule. See the
width attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLModElement
-
Notice of modification to part of a document. See the INS and DEL element definitions in HTML 4.01.
IDL Definition-
- Attributes
-
citeof typeDOMString- A URI [IETF RFC 2396] designating a
document that describes the reason for the change. See the cite
attribute definition in HTML 4.01.
dateTimeof typeDOMString- The date and time of the change. See the
datetime attribute definition in HTML 4.01.
- Interface HTMLAnchorElement
-
The anchor element. See the A element definition in HTML 4.01.
IDL Definition-
- Attributes
-
accessKeyof typeDOMString- A single character access key to give access to the form
control. See the
accesskey attribute definition in HTML 4.01.
charsetof typeDOMString- The character encoding of the linked resource. See the
charset attribute definition in HTML 4.01.
coordsof typeDOMString- Comma-separated list of lengths, defining an active region
geometry. See also
shapefor the shape of the region. See the coords attribute definition in HTML 4.01.
hrefof typeDOMString- The absolute URI [IETF RFC 2396] of the linked
resource. See the
href attribute definition in HTML 4.01.
hreflangof typeDOMString- Language code of the linked resource. See the
hreflang attribute definition in HTML 4.01.
nameof typeDOMString- Anchor name. See the
name attribute definition in HTML 4.01.
relof typeDOMString- Forward link type. See the
rel attribute definition in HTML 4.01.
revof typeDOMString- Reverse link type. See the
rev attribute definition in HTML 4.01.
shapeof typeDOMString- The shape of the active area. The coordinates are given by
coords. See the shape attribute definition in HTML 4.01.
tabIndexof typelong- Index that represents the element's position in the tabbing
order. See the
tabindex attribute definition in HTML 4.01.
targetof typeDOMString- Frame to render the resource in. See the
target attribute definition in HTML 4.01.
typeof typeDOMString- Advisory content type. See the
type attribute definition in HTML 4.01.
- Methods
- Interface HTMLImageElement
-
Embedded image. See the IMG element definition in HTML 4.01.
IDL Definition-
interface HTMLImageElement : HTMLElement { attribute DOMString name; attribute DOMString align; attribute DOMString alt; attribute DOMString border; // Modified in DOM Level 2: attribute long height; // Modified in DOM Level 2: attribute long hspace; attribute boolean isMap; attribute DOMString longDesc; attribute DOMString src; attribute DOMString useMap; // Modified in DOM Level 2: attribute long vspace; // Modified in DOM Level 2: attribute long width; };
- Attributes
-
alignof typeDOMString- Aligns this object (vertically or horizontally) with respect to
its surrounding text. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
altof typeDOMString- Alternate text for user agents not rendering the normal content
of this element. See the
alt attribute definition in HTML 4.01.
borderof typeDOMString- Width of border around image. See the
border attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01. Note that the type of this attribute was
DOMStringin DOM Level 1 HTML [DOM Level 1].
heightof typelong, modified in DOM Level 2- Height of the image in pixels. See the
height attribute definition in HTML 4.01. Note that the type of
this attribute was
DOMStringin DOM Level 1 HTML [DOM Level 1].
hspaceof typelong, modified in DOM Level 2- Horizontal space to the left and right of this image in pixels.
See the
hspace attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01. Note that the type of this attribute was
DOMStringin DOM Level 1 HTML [DOM Level 1].
isMapof typeboolean- Use server-side image map. See the
ismap attribute definition in HTML 4.01.
longDescof typeDOMString- URI [IETF RFC 2396] designating a
long description of this image or frame. See the
longdesc attribute definition in HTML 4.01.
nameof typeDOMString- The name of the element (for backwards compatibility).
srcof typeDOMString- URI [IETF RFC 2396] designating the
source of this image. See the
src attribute definition in HTML 4.01.
useMapof typeDOMString- Use client-side image map. See the
usemap attribute definition in HTML 4.01.
vspaceof typelong, modified in DOM Level 2- Vertical space above and below this image in pixels. See the
vspace attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01. Note that the type of this attribute was
"DOMString" in DOM Level 1 HTML [DOM Level 1].
widthof typelong, modified in DOM Level 2- The width of the image in pixels. See the
width attribute definition in HTML 4.01. Note that the type of
this attribute was
DOMStringin DOM Level 1 HTML [DOM Level 1].
- Interface HTMLObjectElement
-
Generic embedded object.
Note: In principle, all properties on the object element are read-write but in some environments some properties may be read-only once the underlying object is instantiated. See the OBJECT element definition in [HTML 4.01].
IDL Definition-
- Attributes
-
alignof typeDOMString- Aligns this object (vertically or horizontally) with respect to
its surrounding text. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
archiveof typeDOMString- Space-separated list of archives. See the
archive attribute definition in HTML 4.01.
borderof typeDOMString- Width of border around the object. See the
border attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
codeof typeDOMString- Applet class file. See the
codeattribute for HTMLAppletElement.
codeBaseof typeDOMString- Base URI [IETF RFC 2396] for
classid,data, andarchiveattributes. See the codebase attribute definition in HTML 4.01.
codeTypeof typeDOMString- Content type for data downloaded via
classidattribute. See the codetype attribute definition in HTML 4.01.
contentDocumentof typeDocument, readonly, introduced in DOM Level 2- The document this object contains, if there is any and it is
available, or
nullotherwise.
dataof typeDOMString- A URI [IETF RFC 2396] specifying the
location of the object's data. See the
data attribute definition in HTML 4.01.
declareof typeboolean- Declare (for future reference), but do not instantiate, this
object. See the
declare attribute definition in HTML 4.01.
formof typeHTMLFormElement, readonly- Returns the
FORMelement containing this control. Returnsnullif this control is not within the context of a form.
heightof typeDOMString- Override height. See the
height attribute definition in HTML 4.01.
hspaceof typelong- Horizontal space, in pixels, to the left and right of this
image, applet, or object. See the
hspace attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
nameof typeDOMString- Form control or object name when submitted with a form. See the
name attribute definition in HTML 4.01.
standbyof typeDOMString- Message to render while loading the object. See the
standby attribute definition in HTML 4.01.
tabIndexof typelong- Index that represents the element's position in the tabbing
order. See the
tabindex attribute definition in HTML 4.01.
typeof typeDOMString- Content type for data downloaded via
dataattribute. See the type attribute definition in HTML 4.01.
useMapof typeDOMString- Use client-side image map. See the
usemap attribute definition in HTML 4.01.
vspaceof typelong- Vertical space, in pixels, above and below this image, applet,
or object. See the
vspace attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
widthof typeDOMString- Override width. See the
width attribute definition in HTML 4.01.
- Interface HTMLParamElement
-
Parameters fed to the
OBJECTelement. See the PARAM element definition in HTML 4.01.
IDL Definition-
- Attributes
-
nameof typeDOMString- The name of a run-time parameter. See the
name attribute definition in HTML 4.01.
typeof typeDOMString- Content type for the
valueattribute whenvaluetypehas the value "ref". See the type attribute definition in HTML 4.01.
valueof typeDOMString- The value of a run-time parameter. See the
value attribute definition in HTML 4.01.
valueTypeof typeDOMString- Information about the meaning of the
valueattribute value. See the valuetype attribute definition in HTML 4.01.
- Interface HTMLAppletElement
-
An embedded Java applet. See the APPLET element definition in HTML 4.01. This element is deprecated in HTML 4.01.
IDL Definition-
- Attributes
-
alignof typeDOMString- Aligns this object (vertically or horizontally) with respect to
its surrounding text. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
altof typeDOMString- Alternate text for user agents not rendering the normal content
of this element. See the
alt attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
archiveof typeDOMString- Comma-separated archive list. See the
archive attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
codeof typeDOMString- Applet class file. See the
code attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
codeBaseof typeDOMString- Optional base URI [IETF RFC 2396] for applet. See
the
codebase attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
heightof typeDOMString- Override height. See the
height attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
hspaceof typelong, modified in DOM Level 2- Horizontal space, in pixels, to the left and right of this
image, applet, or object. See the
hspace attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
nameof typeDOMString- The name of the applet. See the
name attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
objectof typeDOMString, modified in DOM Level 2- The value of the "object" attribute. See the
object attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
vspaceof typelong, modified in DOM Level 2- Vertical space, in pixels, above and below this image, applet,
or object. See the
vspace attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
widthof typeDOMString- Override width. See the
width attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLMapElement
-
Client-side image map. See the MAP element definition in HTML 4.01.
IDL Definition-
- Attributes
-
areasof typeHTMLCollection, readonly- The list of areas defined for the image map.
nameof typeDOMString- Names the map (for use with
usemap). See the name attribute definition in HTML 4.01.
- Interface HTMLAreaElement
-
Client-side image map area definition. See the AREA element definition in HTML 4.01.
IDL Definition-
- Attributes
-
accessKeyof typeDOMString- A single character access key to give access to the form
control. See the
accesskey attribute definition in HTML 4.01.
altof typeDOMString- Alternate text for user agents not rendering the normal content
of this element. See the
alt attribute definition in HTML 4.01.
coordsof typeDOMString- Comma-separated list of lengths, defining an active region
geometry. See also
shapefor the shape of the region. See the coords attribute definition in HTML 4.01.
hrefof typeDOMString- The URI [IETF RFC 2396] of the linked
resource. See the
href attribute definition in HTML 4.01.
noHrefof typeboolean- Specifies that this area is inactive, i.e., has no associated
action. See the
nohref attribute definition in HTML 4.01.
shapeof typeDOMString- The shape of the active area. The coordinates are given by
coords. See the shape attribute definition in HTML 4.01.
tabIndexof typelong- Index that represents the element's position in the tabbing
order. See the
tabindex attribute definition in HTML 4.01.
targetof typeDOMString- Frame to render the resource in. See the
target attribute definition in HTML 4.01.
- Interface HTMLScriptElement
-
Script statements. See the SCRIPT element definition in HTML 4.01.
IDL Definition-
- Attributes
-
charsetof typeDOMString- The character encoding of the linked resource. See the
charset attribute definition in HTML 4.01.
deferof typeboolean- Indicates that the user agent can defer processing of the
script. See the
defer attribute definition in HTML 4.01.
eventof typeDOMString- Reserved for future use.
htmlForof typeDOMString- Reserved for future use.
srcof typeDOMString- URI [IETF RFC 2396] designating an
external script. See the
src attribute definition in HTML 4.01.
textof typeDOMString- The script content of the element.
typeof typeDOMString- The content type of the script language. See the
type attribute definition in HTML 4.01.
- Interface HTMLTableElement
-
The create* and delete* methods on the table allow authors to construct and modify tables. [HTML 4.01] specifies that only one of each of the
CAPTION,THEAD, andTFOOTelements may exist in a table. Therefore, if one exists, and the createTHead() or createTFoot() method is called, the method returns the existing THead or TFoot element. See the TABLE element definition in HTML 4.01.
IDL Definition-
- Attributes
-
alignof typeDOMString- Specifies the table's position with respect to the rest of the
document. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
bgColorof typeDOMString- Cell background color. See the
bgcolor attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
borderof typeDOMString- The width of the border around the table. See the
border attribute definition in HTML 4.01.
captionof typeHTMLTableCaptionElement, modified in DOM Level 2- Returns the table's
CAPTION, or void if none exists.
Exceptions on setting
DOMExceptionHIERARCHY_REQUEST_ERR: if the element is not a
CAPTION. cellPaddingof typeDOMString- Specifies the horizontal and vertical space between cell
content and cell borders. See the
cellpadding attribute definition in HTML 4.01.
cellSpacingof typeDOMString- Specifies the horizontal and vertical separation between cells.
See the
cellspacing attribute definition in HTML 4.01.
frameof typeDOMString- Specifies which external table borders to render. See the
frame attribute definition in HTML 4.01.
rowsof typeHTMLCollection, readonly- Returns a collection of all the rows in the table, including
all in
THEAD,TFOOT, allTBODYelements.
rulesof typeDOMString- Specifies which internal table borders to render. See the
rules attribute definition in HTML 4.01.
summaryof typeDOMString- Description about the purpose or structure of a table. See the
summary attribute definition in HTML 4.01.
tBodiesof typeHTMLCollection, readonly- Returns a collection of the table bodies (including implicit
ones).
tFootof typeHTMLTableSectionElement, modified in DOM Level 2- Returns the table's
TFOOT, ornullif none exists.
Exceptions on setting
DOMExceptionHIERARCHY_REQUEST_ERR: if the element is not a
TFOOT. tHeadof typeHTMLTableSectionElement, modified in DOM Level 2- Returns the table's
THEAD, ornullif none exists.
Exceptions on setting
DOMExceptionHIERARCHY_REQUEST_ERR: if the element is not a
THEAD. widthof typeDOMString- Specifies the desired table width. See the
width attribute definition in HTML 4.01.
- Methods
-
createCaption-
Create a new table caption object or return an existing one.
No Parameters
No Exceptions
createTFoot-
Create a table footer row or return an existing one.
No Parameters
No Exceptions
createTHead-
Create a table header row or return an existing one.
No Parameters
No Exceptions
deleteCaption-
Delete the table caption, if one exists.
No Parameters
No Return Value
No Exceptions
deleteRowmodified in DOM Level 2-
Delete a table row.
Parameters
indexof typelong- The index of the row to be deleted. This index starts from 0
and is relative to the logical order (not document order) of all
the rows contained inside the table. If the index is -1 the last
row in the table is deleted.
Exceptions
DOMExceptionINDEX_SIZE_ERR: Raised if the specified index is greater than or equal to the number of rows or if the index is a negative number other than -1.
No Return Value
deleteTFoot-
Delete the footer from the table, if one exists.
No Parameters
No Return Value
No Exceptions
deleteTHead-
Delete the header from the table, if one exists.
No Parameters
No Return Value
No Exceptions
insertRowmodified in DOM Level 2-
Insert a new empty row in the table. The new row is inserted immediately before and in the same section as the current
indexth row in the table. Ifindexis -1 or equal to the number of rows, the new row is appended. In addition, when the table is empty the row is inserted into aTBODYwhich is created and inserted into the table.Note: A table row cannot be empty according to [HTML 4.01].
Parameters
indexof typelong- The row number where to insert a new row. This index starts
from 0 and is relative to the logical order (not document order) of
all the rows contained inside the table.
Exceptions
DOMExceptionINDEX_SIZE_ERR: Raised if the specified index is greater than the number of rows or if the index is a negative number other than -1.
- Interface HTMLTableCaptionElement
-
Table caption See the CAPTION element definition in HTML 4.01.
IDL Definition-
- Attributes
-
alignof typeDOMString- Caption alignment with respect to the table. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLTableColElement
-
Regroups the
COLandCOLGROUPelements. See the COL element definition in HTML 4.01.
IDL Definition-
- Attributes
-
alignof typeDOMString- Horizontal alignment of cell data in column. See the
align attribute definition in HTML 4.01.
chof typeDOMString- Alignment character for cells in a column. See the
char attribute definition in HTML 4.01.
chOffof typeDOMString- Offset of alignment character. See the
charoff attribute definition in HTML 4.01.
spanof typelong- Indicates the number of columns in a group or affected by a
grouping. See the
span attribute definition in HTML 4.01.
vAlignof typeDOMString- Vertical alignment of cell data in column. See the
valign attribute definition in HTML 4.01.
widthof typeDOMString- Default column width. See the
width attribute definition in HTML 4.01.
- Interface HTMLTableSectionElement
-
The
THEAD,TFOOT, andTBODYelements.
IDL Definition-
- Attributes
-
alignof typeDOMString- Horizontal alignment of data in cells. See the
alignattribute for HTMLTheadElement for details.
chof typeDOMString- Alignment character for cells in a column. See the
char attribute definition in HTML 4.01.
chOffof typeDOMString- Offset of alignment character. See the
charoff attribute definition in HTML 4.01.
rowsof typeHTMLCollection, readonly- The collection of rows in this table section.
vAlignof typeDOMString- Vertical alignment of data in cells. See the
valignattribute for HTMLTheadElement for details.
- Methods
-
deleteRowmodified in DOM Level 2-
Delete a row from this section.
Parameters
indexof typelong- The index of the row to be deleted, or -1 to delete the last
row. This index starts from 0 and is relative only to the rows
contained inside this section, not all the rows in the table.
Exceptions
DOMExceptionINDEX_SIZE_ERR: Raised if the specified index is greater than or equal to the number of rows or if the index is a negative number other than -1.
No Return Value
insertRowmodified in DOM Level 2-
Insert a row into this section. The new row is inserted immediately before the current
indexth row in this section. Ifindexis -1 or equal to the number of rows in this section, the new row is appended.Parameters
indexof typelong- The row number where to insert a new row. This index starts
from 0 and is relative only to the rows contained inside this
section, not all the rows in the table.
Exceptions
DOMExceptionINDEX_SIZE_ERR: Raised if the specified index is greater than the number of rows of if the index is a negative number other than -1.
- Interface HTMLTableRowElement
-
A row in a table. See the TR element definition in HTML 4.01.
IDL Definition-
- Attributes
-
alignof typeDOMString- Horizontal alignment of data within cells of this row. See the
align attribute definition in HTML 4.01.
bgColorof typeDOMString- Background color for rows. See the
bgcolor attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
cellsof typeHTMLCollection, readonly, modified in DOM Level 2- The collection of cells in this row.
chof typeDOMString- Alignment character for cells in a column. See the
char attribute definition in HTML 4.01.
chOffof typeDOMString- Offset of alignment character. See the
charoff attribute definition in HTML 4.01.
rowIndexof typelong, readonly, modified in DOM Level 2- This is in logical order and not in document order. The
rowIndexdoes take into account sections (THEAD,TFOOT, orTBODY) within the table, placingTHEADrows first in the index, followed byTBODYrows, followed byTFOOTrows.
sectionRowIndexof typelong, readonly, modified in DOM Level 2- The index of this row, relative to the current section
(
THEAD,TFOOT, orTBODY), starting from 0.
vAlignof typeDOMString- Vertical alignment of data within cells of this row. See the
valign attribute definition in HTML 4.01.
- Methods
-
deleteCellmodified in DOM Level 2-
Delete a cell from the current row.
Parameters
indexof typelong- The index of the cell to delete, starting from 0. If the index
is -1 the last cell in the row is deleted.
Exceptions
DOMExceptionINDEX_SIZE_ERR: Raised if the specified
indexis greater than or equal to the number of cells or if the index is a negative number other than -1.No Return Value
insertCellmodified in DOM Level 2-
Insert an empty
TDcell into this row. Ifindexis -1 or equal to the number of cells, the new cell is appended.Parameters
indexof typelong- The place to insert the cell, starting from 0.
Exceptions
DOMExceptionINDEX_SIZE_ERR: Raised if the specified
indexis greater than the number of cells or if the index is a negative number other than -1.
- Interface HTMLTableCellElement
-
The object used to represent the
THandTDelements. See the TD element definition in HTML 4.01.
IDL Definition-
- Attributes
-
abbrof typeDOMString- Abbreviation for header cells. See the
abbr attribute definition in HTML 4.01.
alignof typeDOMString- Horizontal alignment of data in cell. See the
align attribute definition in HTML 4.01.
axisof typeDOMString- Names group of related headers. See the
axis attribute definition in HTML 4.01.
bgColorof typeDOMString- Cell background color. See the
bgcolor attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
cellIndexof typelong, readonly- The index of this cell in the row, starting from 0. This index
is in document tree order and not display order.
chof typeDOMString- Alignment character for cells in a column. See the
char attribute definition in HTML 4.01.
chOffof typeDOMString- Offset of alignment character. See the
charoff attribute definition in HTML 4.01.
colSpanof typelong- Number of columns spanned by cell. See the
colspan attribute definition in HTML 4.01.
headersof typeDOMString- List of
idattribute values for header cells. See the headers attribute definition in HTML 4.01.
heightof typeDOMString- Cell height. See the
height attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
noWrapof typeboolean- Suppress word wrapping. See the
nowrap attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
rowSpanof typelong- Number of rows spanned by cell. See the
rowspan attribute definition in HTML 4.01.
scopeof typeDOMString- Scope covered by header cells. See the
scope attribute definition in HTML 4.01.
vAlignof typeDOMString- Vertical alignment of data in cell. See the
valign attribute definition in HTML 4.01.
widthof typeDOMString- Cell width. See the
width attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
- Interface HTMLFrameSetElement
-
Create a grid of frames. See the FRAMESET element definition in HTML 4.01.
IDL Definition-
- Attributes
-
colsof typeDOMString- The number of columns of frames in the frameset. See the
cols attribute definition in HTML 4.01.
rowsof typeDOMString- The number of rows of frames in the frameset. See the
rows attribute definition in HTML 4.01.
- Interface HTMLFrameElement
-
Create a frame. See the FRAME element definition in HTML 4.01.
IDL Definition-
- Attributes
-
contentDocumentof typeDocument, readonly, introduced in DOM Level 2- The document this frame contains, if there is any and it is
available, or
nullotherwise.
frameBorderof typeDOMString- Request frame borders. See the
frameborder attribute definition in HTML 4.01.
longDescof typeDOMString- URI [IETF RFC 2396] designating a
long description of this image or frame. See the
longdesc attribute definition in HTML 4.01.
marginHeightof typeDOMString- Frame margin height, in pixels. See the
marginheight attribute definition in HTML 4.01.
marginWidthof typeDOMString- Frame margin width, in pixels. See the
marginwidth attribute definition in HTML 4.01.
nameof typeDOMString- The frame name (object of the
targetattribute). See the name attribute definition in HTML 4.01.
noResizeof typeboolean- When true, forbid user from resizing frame. See the
noresize attribute definition in HTML 4.01.
scrollingof typeDOMString- Specify whether or not the frame should have scrollbars. See
the
scrolling attribute definition in HTML 4.01.
srcof typeDOMString- A URI [IETF RFC 2396] designating the
initial frame contents. See the
src attribute definition in HTML 4.01.
- Interface HTMLIFrameElement
-
Inline subwindows. See the IFRAME element definition in HTML 4.01.
IDL Definition-
- Attributes
-
alignof typeDOMString- Aligns this object (vertically or horizontally) with respect to
its surrounding text. See the
align attribute definition in HTML 4.01. This attribute is
deprecated in HTML 4.01.
contentDocumentof typeDocument, readonly, introduced in DOM Level 2- The document this frame contains, if there is any and it is
available, or
nullotherwise.
frameBorderof typeDOMString- Request frame borders. See the
frameborder attribute definition in HTML 4.01.
heightof typeDOMString- Frame height. See the
height attribute definition in HTML 4.01.
longDescof typeDOMString- URI [IETF RFC 2396] designating a
long description of this image or frame. See the
longdesc attribute definition in HTML 4.01.
marginHeightof typeDOMString- Frame margin height, in pixels. See the
marginheight attribute definition in HTML 4.01.
marginWidthof typeDOMString- Frame margin width, in pixels. See the
marginwidth attribute definition in HTML 4.01.
nameof typeDOMString- The frame name (object of the
targetattribute). See the name attribute definition in HTML 4.01.
scrollingof typeDOMString- Specify whether or not the frame should have scrollbars. See
the
scrolling attribute definition in HTML 4.01.
srcof typeDOMString- A URI [IETF RFC 2396] designating the
initial frame contents. See the
src attribute definition in HTML 4.01.
widthof typeDOMString- Frame width. See the
width attribute definition in HTML 4.01.