2.1.4 [DOM Level 2 - HTML] Section 1.6.5, Object definitions

V0002:

The specification states:

 form of type HTMLFormElement, readonly  
 Returns the FORM element containing this control. Returns null if this control is 
 not within the context of a form.

IE7 Mode, IE8 Mode, IE9 Mode, IE10 Mode, and IE11 Mode (All Versions)

The form property of the ISINDEX element does not return NULL when the control is outside the context of a form.

V0003:

The specification states:

 text of type DOMString
 Document text color. See the text attribute definition in HTML 4.01. This attribute 
 is deprecated in HTML 4.01.

Quirks Mode, IE7 Mode, IE8 Mode, IE9 Mode, and IE10 Mode (All Versions)

The value of the text attribute is converted into a hexadecimal RGB value.

V0004:

The specification states:

 add 
 Add a new element to the collection of OPTION elements for this SELECT. This method 
 is the equivalent of the appendChild method of the Node interface if the before 
 parameter is null. It is equivalent to the insertBefore method on the parent of 
 before in all other cases. This method may have no effect if the new element is not 
 an OPTION or an OPTGROUP. 
  
 Parameters
 element of type HTMLElement 
 The element to add.
  
 before of type HTMLElement
 The element to insert before, or null for the tail of the list. 
  
 Exceptions
 DOMException
 NOT_FOUND_ERR: Raised if before is not a descendant of the SELECT element.
  
 No Return Value

Quirks Mode and IE7 Mode (All Versions)

The before parameter of the add method of the HTMLSelectElement interface is not supported.

All Document Modes (All Versions)

The DOMException NOT_FOUND_ERR is not raised by the add method of the HTMLSelectElement interface.

V0005:

The specification states:

 interface HTMLOptionElement : HTMLElement
  
 selected of type boolean
 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.

All Document Modes (All Versions)

Changing the value of the selected attribute of HTMLOptionElement results in an equivalent change to the value of the HTML selected attribute of the element.

V0006:

The specification states:

 align of type DOMString
 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.

All Document Modes (All Versions)

The value of the align attribute of the HTMLInputElement interface returns an empty string ("").

V0008:

The specification states:

 interface HTMLInputElement : HTMLElement
 value of type DOMString 
 When the type attribute 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 the type attribute 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.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

Changing the value attribute of the HTMLInputElement interface to a text, file, or password input type results in an equivalent change to the HTML value attribute of the element. The value attribute is an empty string for an input type of file.

V0010:

The specification states:

 value of type long
 Reset sequence number when used in OL. See the value attribute definition in HTML 
 4.01. This attribute is deprecated in HTML 4.01.

Quirks Mode, IE7 Mode, IE8 Mode, and IE9 Mode (All Versions)

The value attribute of the HTMLLIElement interface cannot be used to reset the sequence number of an OL element (ordered list).

V0011:

The specification states:

 Interface HTMLPreElement
 Preformatted text. See the PRE element definition in HTML 4.01.
 IDL Definition
 interface HTMLPreElement : HTMLElement {
 attribute long            width;
 };

IE7 Mode, IE8 Mode, IE9 Mode, IE10 Mode, and IE11 Mode (All Versions)

The width attribute of the HTMLPreElement interface is of type string.

V0012:

The specification states:

 color of type DOMString
 Font color. See the color attribute definition in HTML 4.01. This attribute is 
 deprecated in HTML 4.01.

IE11 Mode and EdgeHTML Mode (All Versions)

The color attribute of the HTMLBaseFontElement interface returns the RGB hexadecimal value for a color string (for example, the color string blue is converted to #0000FF).

V0013:

The specification states:

 isMap of type boolean
 Use server-side image map. See the ismap attribute definition in HTML 4.01.

All Document Modes (All Versions)

The isMap attribute of the HTMLImageElement interface always returns a value of true, even when the value is set to false.

V0014:

The specification states:

 interface HTMLObjectElement : HTMLElement
 codeBase of type DOMString
 Base URI for classid, data, and archive attributes. See the codebase attribute 
 definition in HTML 4.01.

All Document Modes (All Versions)

If the codeBase attribute of the OBJECT element is not specified in HTML, the codeBase attribute of the HTMLObjectElement interface returns an empty string. Otherwise, if the codeBase attribute is specified in HTML, codeBase returns the base URI of the current document appended with the value specified for the codeBase attribute.

V0015:

The specification states:

 interface HTMLObjectElement : HTMLElement
 codeType of type DOMString
 Content type for data downloaded via classid attribute. See the codetype attribute 
 definition in HTML 4.01.

All Document Modes (All Versions)

If the codetype attribute of the object element is not specified in HTML, or the attribute is declared without an assigned value, the codeType attribute of HTMLObjectElement returns an empty string as a default value instead of the value of the type attribute for the object element.

V0016:

The specification states:

 form of type HTMLFormElement, readonly
 Returns the FORM element containing this control. Returns null if this control is 
 not within the context of a form.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

Returns the form element even if the control is not within the context of a form.

V0017:

The specification states:

 object of type DOMString, 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.

IE17 Mode, IE8 Mode, IE9 Mode, IE10 Mode, and IE11 Mode (All Versions)

The object attribute of the HTMLAppletElement interface is not supported.

V0018:

The specification states:

 ch of type DOMString
 Alignment character for cells in a column. See the char attribute definition in 
 HTML 4.01.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The ch attribute of the TR element is not supported. The value of the ch attribute can be set, but it does not change the alignment of text within a cell.

V0019:

The specification states:

 chOff of type DOMString
 Offset of alignment character. See the charoff attribute definition in HTML 4.01.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The chOff attribute of the TR element is not supported. The value of the chOff attribute can be set, but it does not change the offset of the alignment.

V0020:

The specification states:

 deleteCell modified in DOM Level 2
 Delete a cell from the current row. 
  
 Parameters 
 index of type long 
 The index of the cell to delete, starting from 0. If the index is -1 the last cell 
 in the row is deleted.
  
Exceptions 
DOMException INDEX_SIZE_ERR: Raised if the specified index is greater than or equal 
to the number of cells or if the index is a negative number other than -1.
 
No Return Value

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

If the specified index is greater than or equal to the number of cells or if the index is a negative number other than –1, the deleteCell method of the HTMLTableRowElement interface throws a JScript Error object with a description of "Invalid argument" and an error number of 0x80070057 (-2147024809).

V0021:

The specification states:

 insertCell modified in DOM Level 2
 Insert an empty TD cell into this row. If index is -1 or equal to the number of 
 cells, the new cell is appended. 
 Parameters 
 index of type long
 The place to insert the cell, starting from 0.
  
 Return Value 
 HTMLElement 
 The newly created cell.
  
 Exceptions 
 DOMException INDEX_SIZE_ERR: Raised if the specified index is greater than the 
 number of cells or if the index is a negative number other than -1.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

If the specified index is greater than or equal to the number of cells or if the index is a negative number other than –1, the insertCell method of the HTMLTableRowElement interface throws a JScript Error object with a description of "Invalid argument" and an error number of 0x80070057 (-2147024809).

V0022:

The specification states:

 rowSpan of type long
 Number of rows spanned by cell. See the rowspan attribute definition in HTML 4.01.

Quirks Mode and IE7 Mode (All Versions)

Setting the value of the rowSpan attribute of the HTMLTableCellElement interface to a number greater than the actual number of rows in the table results in the value being clipped to the actual number of rows.

V0023:

The specification states:

 contentDocument of type Document, readonly, introduced in DOM Level 2
 The document this frame contains, if there is any and it is available, or null 
 otherwise.

Quirks Mode and IE7 Mode (All Versions)

The contentDocument attribute is not supported on the HTMLIFrameElement interface.

IE8 Mode (Internet Explorer 8)

When the HTMLIFrameElement object is empty, the contentDocument attribute returns the document this frame contains. When the src attribute of the HTMLIFrameElement is set to a different domain, access to the contentDocument attribute is denied.

V0030:

The specification states:

 version of type DOMString
 Version information about the document's DTD. See the version attribute definition 
 in HTML 4.01. This attribute is deprecated in HTML 4.01.

All Document Modes (All Versions)

The version attribute of the HTMLHtmlElement interface returns an empty string ("").

V0031:

The specification states:

 media of type DOMString  
 Designed for use with one or more target media. See the media attribute definition 
 in HTML 4.01.

All Document Modes (All Versions)

The default value for the media attribute of the HTMLLinkElement is the empty string instead of the expected value of screen.

V0032:

The specification states:

 acceptCharset of type DOMString  
 List of character sets supported by the server. See the accept-charset attribute 
 definition in HTML 4.01.

All Document Modes (All Versions)

If the value of the acceptCharset attribute of the HTMLFormElement interface is not set, a default value of UNKNOWN is returned.

V0035:

The specification states:

 value of type DOMString
 The current form control value. See the value attribute definition in HTML 4.01.

Quirks and IE7 Mode (All Versions)

The value attribute of the HTMLButtonElement interface returns the contents of the element.

V0036:

The specification states:

 focus
 Gives keyboard focus to this element. 
 No Parameters
 No Return Value
 No Exceptions

All Document Modes (Internet Explorer 7)

The focus method of the HTMLAnchorElement interface is not supported.

V0037:

The specification states:

 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
 interface HTMLObjectElement : HTMLElement {
 readonly attribute HTMLFormElement form;
 attribute DOMString       code;
 attribute DOMString       align;
 attribute DOMString       archive;
 attribute DOMString       border;
 attribute DOMString       codeBase;
 attribute DOMString       codeType;
 attribute DOMString       data;
 attribute boolean         declare;
 attribute DOMString       height;
 attribute long            hspace;
 attribute DOMString       name;
 attribute DOMString       standby;
 attribute long            tabIndex;
 attribute DOMString       type;
 attribute DOMString       useMap;
 attribute long            vspace;
 attribute DOMString       width;
 // Introduced in DOM Level 2:readonly 
 attribute Document        contentDocument;
 };

Quirks Mode and IE7 Mode (All Versions)

The contentDocument attribute of the HTMLObjectElement interface is undefined.

Quirks Mode and IE7 Mode (Internet Explorer 7 and Internet Explorer 8)

The vspace and hspace attributes are of type string.

V0038:

The specification states:

 align of type DOMStringAligns 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. 

All Document Modes (All Versions)

The align attribute of the HTMLObjectElement interface is undefined. Its value defaults to bottom.

V0039:

The specification states:

 contentDocument of type Document, readonly, introduced in DOM Level 2
 The document this object contains, if there is any and it is available, or null 
 otherwise.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The contentDocument attribute is not supported on the HTMLObjectElement interface.

V0040:

The specification states:

 Interface HTMLParamElement
 Parameters fed to the OBJECT element. See the PARAM element definition in HTML 
 4.01.
 IDL Definition
 interface HTMLParamElement : HTMLElement {
 attribute DOMString       name;
 attribute DOMString       type;
 attribute DOMString       value;
 attribute DOMString       valueType;
 };

Quirks Mode, IE7 Mode, and IE8 Mode (Internet Explorer 7 and Internet Explorer 8)

All attributes of the HTMLParamElement interface are defined only when they are defined in the markup. For an undefined attribute, HTMLParamElement returns undefined.

V0041:

The specification states:

 valueType of type DOMString
 Information about the meaning of the value attribute value. See the valuetype 
 attribute definition in HTML 4.01.

Quirks Mode and IE7 Mode (All Versions)

The valueType attribute of the HTMLParamElement interface returns undefined, not the default value data. If the valuetype attribute of a PARAM element is not specified in HTML, the valueType attribute of the HTMLParamElement interface returns undefined as the default value.

V0042:

The specification states:

 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
 interface HTMLAppletElement : HTMLElement {
 attribute DOMString       align;
 attribute DOMString       alt;
 attribute DOMString       archive;
 attribute DOMString       code;
 attribute DOMString       codeBase;
 attribute DOMString       height;
 // Modified in DOM Level 2:
 attribute long            hspace;
 attribute DOMString       name;
 // Modified in DOM Level 2:
 attribute DOMString       object;
 // Modified in DOM Level 2:
 attribute long            vspace;
 attribute DOMString       width;
 };

Quirks Mode, IE7 Mode, IE8 Mode, IE9 Mode, IE10 Mode, and IE11 Mode (All Versions)

The object attribute of the HTMLAppletElement interface is of type object.

V0043:

The specification states:

 noHref of type boolean
 Specifies that this area is inactive, i.e., has no associated action. See the 
 nohref attribute definition in HTML 4.01. 

IE7 Mode, IE8 Mode, IE9 Mode, IE10 Mode, and IE11 Mode (All Versions)

The noHref attribute of the HTMLAreaElement interface is read-only.

V0044:

The specification states:

 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, and 
TFOOT elements 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
 
interface HTMLTableElement : HTMLElement {
// Modified in DOM Level 2:
attribute HTMLTableCaptionElement caption;
// raises(DOMException) on setting
// Modified in DOM Level 2:
attribute HTMLTableSectionElement tHead;
// raises(DOMException) on setting
// Modified in DOM Level 2:
attribute HTMLTableSectionElement tFoot;
// raises(DOMException) on setting
readonly attribute HTMLCollection  rows;
readonly attribute HTMLCollection  tBodies;
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;
HTMLElement        createTHead();
void               deleteTHead();
HTMLElement        createTFoot();
void               deleteTFoot();
HTMLElement        createCaption();
void               deleteCaption();
// Modified in DOM Level 2:
HTMLElement        insertRow(in long index)raises(DOMException);
// Modified in DOM Level 2:
void               deleteRow(in long index)raises(DOMException);
};

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The following methods are not supported on the HTMLTableElement interface:

  • createTHead

  • deleteTHead

  • createTFoot

  • deleteTFoot

  • createCaption

  • deleteCaption

  • insertRow

  • deleteRow

V0045:

The specification states:

  
 caption of type HTMLTableCaptionElement, 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. 

IE7 Mode and IE8 Mode (All Versions)

The caption attribute of the HTMLTableElement interface is read-only. If this attribute is set, an error object with an error message of "Member not found" and an HRESULT of ‑2147352573 is returned.

V0046:

The specification states:

 tBodies of type HTMLCollection, readonly
  
 Returns a collection of the table bodies (including implicit ones).

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

If a TABLE element contains more than one THEAD or TFOOT element, the tBodies attribute of the HTMLTableElement interface includes these additional THEAD and TFOOT elements in its collection of table bodies.

V0047:

The specification states:

 tFoot of type HTMLTableSectionElement, modified in DOM Level 2
  
 Returns the table's TFOOT, or null if none exists.
  
 Exceptions on setting 
 DOMException HIERARCHY_REQUEST_ERR: if the element is not a TFOOT.

Quirks Mode, IE7 Mode, IE8 Mode, IE9 Mode, and IE10 Mode (All Versions)

If an object of a type other than HTMLTableSectionElement is assigned to the tFoot property, an error object with an error message of "Member not found" and an HRESULT of ‑2147352573 is returned.

IE11 Mode (All Versions)

If an object of a type other than HTMLTableSectionElement is assigned to the tFoot property, then "Error: No such interface supported" is thrown.

V0048:

The specification states:

 tHead of type HTMLTableSectionElement, modified in DOM Level 2
 
 
 Returns the table's THEAD, or null if none exists.
  
 Exceptions on setting 
 DOMException HIERARCHY_REQUEST_ERR: if the element is not a THEAD.

Quirks Mode, IE7 Mode, IE8 Mode, IE9 Mode, and IE10 Mode (All Versions)

If an object of a type other than HTMLTableSectionElement is assigned to the tHead property, an error object with an error message of "Member not found" and an HRESULT of ‑2147352573 is returned.

IE11 Mode (All Versions)

If an object of a type other than HTMLTableSectionElement is assigned to the tHead property, then "Error: No such interface supported" is thrown.

V0049:

The specification states:

 deleteRow modified in DOM Level 2
 Delete a table row.
  
 Parameters 
 index of type long
 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 
DOMException INDEX_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

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

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, the deleteRow method of the HTMLTableElement interface throws a JSErrors exception with an error message of "Invalid argument" and an HRESULT of ‑2147024809 is returned.

V0052:

The specification states:

 insertRow modified 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. If index is -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 a TBODY which is created and inserted into the 
 table. 
  
 Note: A table row cannot be empty according to [HTML 4.01].Parameters index of type 
 longThe 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.
  
Return Value HTMLElement
The newly created row.
 
Exceptions 
DOMException INDEX_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.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

If the specified index is greater than the number of rows or if the index is a negative number other than –1, the insertRow method of the HTMLTableElement interface throws a JSError exception with an error message of "Invalid argument" and an HRESULT of ‑2147024809.

V0053:

The specification states:

 align of type DOMString
 Horizontal alignment of data in cells. See the align attribute for HTMLTheadElement 
 for details.

All Document Modes (All Versions)

If the value of the align attribute for a TBODY, THEAD, or TFOOT element is set to char or justify, the align attribute of the HTMLTableSectionElement interface returns an empty string.

V0054:

The specification states:

 ch of type DOMStringAlignment character for cells in a column. See the char 
 attribute definition in HTML 4.01.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The ch attribute of the HTMLTableSectionElement interface returns an empty string.

V0055:

The specification states:

 chOff of type DOMStringOffset of alignment character. See the charoff attribute 
 definition in HTML 4.01.

Quirks Mode, IE7 Mode, IE8 Mode, IE9 Mode, IE10 Mode, and IE11 Mode (All Versions)

The chOff attribute of the HTMLTableSectionElement interface returns an empty string.

V0056:

The specification states:

 deleteRow modified in DOM Level 2
  
 Delete a row from this section. 
  
 Parameters 
 index of type long
 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 
 DOMException
 INDEX_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.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

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, the deleteRow method of the HTMLTableSectionElement interface throws a JSError exception with an error message of "Invalid argument" and an HRESULT of ‑2147024809 is returned.

V0057:

The specification states:

 insertRow modified in DOM Level 2
  
 Insert a row into this section. The new row is inserted immediately before the 
 current indexth row in this section. If index is -1 or equal to the number of rows 
 in this section, the new row is appended. 
  
 Parameters 
 index of type long
 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.
  
 Return Value 
 HTMLElement The newly created row.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

If the specified index is greater than the number of rows or if the index is a negative number other than –1, the insertRow method of the HTMLTableSectionElement interface throws a JSError exception with an error message of "Invalid argument" and an HRESULT of ‑2147024809 is returned.

V0058:

The specification states:

 align of type DOMStringHorizontal alignment of data in cell. See the align 
 attribute definition in HTML 4.01.

All Document Modes (All Versions)

If the value of the align attribute for a TR or TD element is set to char or justify, the align attribute of the HTMLTableCellElement interface returns an empty string.

V0059:

The specification states:

  
 ch of type DOMStringAlignment character for cells in a column. See the char 
 attribute definition in HTML 4.01.

Quirks Mode, IE7 Mode, and IE8 Mode (All Versions)

The ch attribute of the HTMLTableCellElement interface has no association with the char attribute.

V0060:

The specification states:

 chOff of type DOMStringOffset of alignment character. See the charoff attribute 
 definition in HTML 4.01.

Quirks and IE7 Mode (All Versions)

The chOff attribute of the HTMLTableCellElement interface has no association with the charoff attribute.

V0061:

The specification states:

 useMap of type DOMString
 Use client-side image map. See the usemap attribute definition in HTML 4.01.

All Document Modes (All Versions)

The useMap attribute of the HTMLObjectElement interface is not supported for a MAP element that is a child of an OBJECT element.

Show: