This section extends the Level 1 Core API to describe objects and methods specific to HTML documents. 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:
The term "DOM Level 0" refers to a mix (not formally specified) of HTML document functionalities offered by Netscape Navigator version 3.0 and Microsoft Internet Explorer version 3.0. In some cases, attributes or methods have been included for reasons of backward compatibility with "DOM Level 0".
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. For DOM Level 1, the transitional and frameset DTDs for HTML 4.0 are assumed. Interoperability between implementations is only guaranteed for elements and attributes that are specified in these DTDs.
More specifically, this document includes the following specializations for HTML:
The DOM Level 1 does not include mechanisms to access and
modify style specified through CSS 1. Furthermore, it does not
define an event model for HTML documents. This functionality
is planned to be specified in a future Level of this specification.
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. 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. 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.0
Recommendation, some of them cannot. Similarly, not
all attributes listed below have counterparts in the
HTML 4.0 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.
An HTMLCollection is a list of nodes. An individual node
may be accessed by either ordinal index or the node's
name or id attributes. Note:
Collections in the HTML DOM are assumed to be live meaning
that they are automatically updated when the underlying document is
changed.
interface HTMLCollection {
readonly attribute unsigned long length;
Node item(in unsigned long index);
Node namedItem(in DOMString name);
};
lengthitemindex |
The index of the node to be fetched. The index origin is 0. |
Node at the corresponding position upon
success. A value of null is returned if the index is
out of range. namedItemNode using a name. It
first searches for a Node with a matching
id attribute. If it doesn't find one, it then searches
for a Node with a matching name attribute,
but only on those elements that are allowed a name attribute.
name |
The name of the |
Node with a name or
id attribute whose value corresponds to the specified
string. Upon failure (e.g., no node with this name exists),
returns null.An HTMLDocument is the root of the HTML hierarchy and
holds the entire content. Beside 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 BODY element:
interface HTMLDocument : Document {
attribute DOMString title;
readonly attribute DOMString referrer;
readonly attribute DOMString domain;
readonly attribute DOMString URL;
attribute HTMLElement body;
readonly attribute HTMLCollection images;
readonly attribute HTMLCollection applets;
readonly attribute HTMLCollection links;
readonly attribute HTMLCollection forms;
readonly attribute HTMLCollection anchors;
attribute DOMString cookie;
void open();
void close();
void write(in DOMString text);
void writeln(in DOMString text);
Element getElementById(in DOMString elementId);
NodeList getElementsByName(in DOMString elementName);
};
titleTITLE
element in the head of the document. referrerdomainURLbodyBODY contents, returns the BODY
element, and in frameset documents, this returns the outermost
FRAMESET element. imagesIMG elements in a document.
The behavior is limited to IMG elements for
backwards compatibility.
appletsOBJECT elements that include
applets and APPLET (deprecated) elements in
a document. linksAREA elements and
anchor (A) elements in a document
with a value for the href attribute. formsanchorsA) elements in a document
with a value for the name attribute.Note. For reasons of backwards
compatibility, the returned set of anchors only contains those anchors created with the name
attribute, not those created with the id attribute. cookiename=value;expires=date. open
Open a document stream for writing. If a document exists in the
target, this method clears it.
This method has no parameters.
This method returns nothing.
This method raises no exceptions.
closeopen()
and forces rendering.writeopen(). The text is parsed into the document's structure
model.
text |
The string to be parsed into some structure in the document structure model. |
writelnopen(). The text is parsed into the
document's structure model.
text |
The string to be parsed into some structure in the document structure model. |
getElementByIdid is given by
elementId. If no such element exists, returns null.
Behavior is not defined if more than one element
has this id.
elementId |
The unique |
getElementsByNamename value is given by elementName.
elementName |
The |
HTML attributes are exposed as properties on the element object. The name of the exposed property always uses the naming conventions, and is independent of the case of the attribute in the source document. The data type of the property is determined by the type of the attribute as determined by the HTML 4.0 transitional and frameset DTDs. The attributes have the semantics (including case-sensitivity) given in the HTML 4.0 specification.
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, as is required both for XML and potentially for future versions of HTML. 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., (border)) | boolean |
| Number | long int |
The return value of an attribute that has a data type that is a
value list is always capitalized, 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" then it is
returned as "Left". For attributes with the CDATA
data type, the case of the return value is that given in
the source document.
To avoid name-space conflicts, an attribute with the same
name as a keyword in one of our chosen binding languages is
prefixed. For HTML, the prefix used is "html".
For example, the for attribute of the
LABEL element
collides with loop construct naming conventions and is renamed
htmlFor.
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".
All HTML element interfaces derive from this class. Elements that only expose
the HTML core attributes are represented by the base
HTMLElement interface. These elements are as follows:
Note. The style attribute for this
interface is reserved for future usage.
interface HTMLElement : Element {
attribute DOMString id;
attribute DOMString title;
attribute DOMString lang;
attribute DOMString dir;
attribute DOMString className;
};
idtitlelangdirclassNameRoot of an HTML document. See the HTML element definition in HTML 4.0.
interface HTMLHtmlElement : HTMLElement {
attribute DOMString version;
};
versionDocument head information. See the HEAD element definition in HTML 4.0.
interface HTMLHeadElement : HTMLElement {
attribute DOMString profile;
};
profileThe LINK element 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.0.
interface HTMLLinkElement : HTMLElement {
attribute boolean disabled;
attribute DOMString charset;
attribute DOMString href;
attribute DOMString hreflang;
attribute DOMString media;
attribute DOMString rel;
attribute DOMString rev;
attribute DOMString target;
attribute DOMString type;
};
disabledcharsethrefhreflangmediarelrevtargettypeThe document title. See the TITLE element definition in HTML 4.0.
interface HTMLTitleElement : HTMLElement {
attribute DOMString text;
};
textThis contains generic meta-information about the document. See the META element definition in HTML 4.0.
interface HTMLMetaElement : HTMLElement {
attribute DOMString content;
attribute DOMString httpEquiv;
attribute DOMString name;
attribute DOMString scheme;
};
contenthttpEquivnameschemeDocument base URI. See the BASE element definition in HTML 4.0.
interface HTMLBaseElement : HTMLElement {
attribute DOMString href;
attribute DOMString target;
};
hreftargetThis element is used for single-line text input. See the ISINDEX element definition in HTML 4.0. This element is deprecated in HTML 4.0.
interface HTMLIsIndexElement : HTMLElement {
readonly attribute HTMLFormElement form;
attribute DOMString prompt;
};
formFORM element containing this control.
Returns null if this control is not within the context of a form. promptStyle information. A more detailed style sheet object model is planned to be defined in a separate document. See the STYLE element definition in HTML 4.0.
interface HTMLStyleElement : HTMLElement {
attribute boolean disabled;
attribute DOMString media;
attribute DOMString type;
};
disabledmediatypeThe 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.0.
interface HTMLBodyElement : HTMLElement {
attribute DOMString aLink;
attribute DOMString background;
attribute DOMString bgColor;
attribute DOMString link;
attribute DOMString text;
attribute DOMString vLink;
};
aLinkbackgroundbgColorlinktextvLinkThe FORM element encompasses behavior similar to a
collection and an element. It provides direct access to the contained
input elements as well as the attributes of the form element. See the FORM element definition
in HTML 4.0.
interface HTMLFormElement : HTMLElement {
readonly attribute HTMLCollection elements;
readonly attribute long length;
attribute DOMString name;
attribute DOMString acceptCharset;
attribute DOMString action;
attribute DOMString enctype;
attribute DOMString method;
attribute DOMString target;
void submit();
void reset();
};
elementslengthnameacceptCharsetactionenctypemethodtargetsubmitresetThe 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.0.
interface HTMLSelectElement : HTMLElement {
readonly attribute DOMString type;
attribute long selectedIndex;
attribute DOMString value;
readonly attribute long length;
readonly attribute HTMLFormElement form;
readonly attribute HTMLCollection options;
attribute boolean disabled;
attribute boolean multiple;
attribute DOMString name;
attribute long size;
attribute long tabIndex;
void add(in HTMLElement element,
in HTMLElement before);
void remove(in long index);
void blur();
void focus();
};
typeselectedIndexvaluelengthSELECT. formFORM element containing this control.
Returns null if this control is not within the context of a form. optionsOPTION elements contained by this element. disabledmultipleOPTION elements may
be selected in this SELECT. See the multiple attribute definition
in HTML 4.0.namesizetabIndexaddOPTION elements
for this SELECT.
element |
The element to add. | |
before |
The element to insert before, or NULL for the head of the list. |
removeOPTION elements
for this SELECT. Does nothing if no element has the given
index.
index |
The index of the item to remove. |
blurfocusGroup options together in logical subdivisions. See the OPTGROUP element definition in HTML 4.0.
interface HTMLOptGroupElement : HTMLElement {
attribute boolean disabled;
attribute DOMString label;
};
disabledlabelA selectable choice. See the OPTION element definition in HTML 4.0.
interface HTMLOptionElement : HTMLElement {
readonly attribute HTMLFormElement form;
attribute boolean defaultSelected;
readonly attribute DOMString text;
attribute long index;
attribute boolean disabled;
attribute DOMString label;
readonly attribute boolean selected;
attribute DOMString value;
};
formFORM element containing this control.
Returns null if this control is not within the context of a form. defaultSelectedselected attribute. textindexOPTION in its parent SELECT. disabledlabelselectedvalueForm control. Note. Depending upon the environment 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.0.
interface HTMLInputElement : HTMLElement {
attribute DOMString defaultValue;
attribute boolean defaultChecked;
readonly attribute HTMLFormElement form;
attribute DOMString accept;
attribute DOMString accessKey;
attribute DOMString align;
attribute DOMString alt;
attribute boolean checked;
attribute boolean disabled;
attribute long maxLength;
attribute DOMString name;
attribute boolean readOnly;
attribute DOMString size;
attribute DOMString src;
attribute long tabIndex;
readonly attribute DOMString type;
attribute DOMString useMap;
attribute DOMString value;
void blur();
void focus();
void select();
void click();
};
defaultValuevalue). defaultCheckedtype has the value "Radio" or "Checkbox",
stores the initial value of the checked attribute. formFORM element containing this control.
Returns null if this control is not within the context of a form. acceptaccessKeyalignaltcheckedtype has the value "Radio" or "Checkbox". The value is
TRUE if explicitly set. Represents the current state of the checkbox
or radio button. See the checked attribute definition
in HTML 4.0.disabledmaxLengthtype
has the value "Text" or "Password". See the maxlength attribute definition
in HTML 4.0.namereadOnlytype has the value "text"
or "password" only. See the readonly attribute definition
in HTML 4.0.sizesrctype attribute 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.0.tabIndextypeuseMapvalueblurfocusselectINPUT elements
whose type attribute has one of the following values:
"Text", "File", or "Password".clickINPUT elements whose
type attribute has one of the following
values: "Button", "Checkbox", "Radio", "Reset", or "Submit".Multi-line text field. See the TEXTAREA element definition in HTML 4.0.
interface HTMLTextAreaElement : HTMLElement {
attribute DOMString defaultValue;
readonly attribute HTMLFormElement form;
attribute DOMString accessKey;
attribute long cols;
attribute boolean disabled;
attribute DOMString name;
attribute boolean readOnly;
attribute long rows;
attribute long tabIndex;
readonly attribute DOMString type;
attribute DOMString value;
void blur();
void focus();
void select();
};
defaultValuevalue). formFORM element containing this control.
Returns null if this control is not within the context of a form. accessKeycolsdisablednamereadOnlyrowstabIndextypevalueblurfocusselectTEXTAREA.Push button. See the BUTTON element definition in HTML 4.0.
interface HTMLButtonElement : HTMLElement {
readonly attribute HTMLFormElement form;
attribute DOMString accessKey;
attribute boolean disabled;
attribute DOMString name;
attribute long tabIndex;
readonly attribute DOMString type;
attribute DOMString value;
};
formFORM element containing this control.
Returns null if this control is not within the context of a form. accessKeydisablednametabIndextypevalueForm field label text. See the LABEL element definition in HTML 4.0.
interface HTMLLabelElement : HTMLElement {
readonly attribute HTMLFormElement form;
attribute DOMString accessKey;
attribute DOMString htmlFor;
};
formFORM element containing this control.
Returns null if this control is not within the context of a form. accessKeyhtmlForid attribute. See the for attribute definition
in HTML 4.0.Organizes form controls into logical groups. See the FIELDSET element definition in HTML 4.0.
interface HTMLFieldSetElement : HTMLElement {
readonly attribute HTMLFormElement form;
};
formFORM element containing this control.
Returns null if this control is not within the context of a form. Provides a caption for a FIELDSET grouping. See the LEGEND element definition
in HTML 4.0.
interface HTMLLegendElement : HTMLElement {
readonly attribute HTMLFormElement form;
attribute DOMString accessKey;
attribute DOMString align;
};
formFORM element containing this control.
Returns null if this control is not within the context of a form. accessKeyalignFIELDSET. See the align attribute definition
in HTML 4.0. This attribute is deprecated in HTML 4.0.Unordered list. See the UL element definition in HTML 4.0.
interface HTMLUListElement : HTMLElement {
attribute boolean compact;
attribute DOMString type;
};
compacttypeOrdered list. See the OL element definition in HTML 4.0.
interface HTMLOListElement : HTMLElement {
attribute boolean compact;
attribute long start;
attribute DOMString type;
};
compactstarttypeDefinition list. See the DL element definition in HTML 4.0.
interface HTMLDListElement : HTMLElement {
attribute boolean compact;
};
compactDirectory list. See the DIR element definition in HTML 4.0. This element is deprecated in HTML 4.0.
interface HTMLDirectoryElement : HTMLElement {
attribute boolean compact;
};
compactMenu list. See the MENU element definition in HTML 4.0. This element is deprecated in HTML 4.0.
interface HTMLMenuElement : HTMLElement {
attribute boolean compact;
};
compactList item. See the LI element definition in HTML 4.0.
interface HTMLLIElement : HTMLElement {
attribute DOMString type;
attribute long value;
};
typevalueOL See the value attribute definition
in HTML 4.0. This attribute is deprecated in HTML 4.0.??? See the BLOCKQUOTE element definition in HTML 4.0.
interface HTMLBlockquoteElement : HTMLElement {
attribute DOMString cite;
};
citeGeneric block container. See the DIV element definition in HTML 4.0.
interface HTMLDivElement : HTMLElement {
attribute DOMString align;
};
alignParagraphs. See the P element definition in HTML 4.0.
interface HTMLParagraphElement : HTMLElement {
attribute DOMString align;
};
alignFor the H1 to H6 elements. See the H1 element definition
in HTML 4.0.
interface HTMLHeadingElement : HTMLElement {
attribute DOMString align;
};
alignFor the Q and BLOCKQUOTE elements. See the Q element definition
in HTML 4.0.
interface HTMLQuoteElement : HTMLElement {
attribute DOMString cite;
};
citePreformatted text. See the PRE element definition in HTML 4.0.
interface HTMLPreElement : HTMLElement {
attribute long width;
};
widthForce a line break. See the BR element definition in HTML 4.0.
interface HTMLBRElement : HTMLElement {
attribute DOMString clear;
};
clearBase font. See the BASEFONT element definition in HTML 4.0. This element is deprecated in HTML 4.0.
interface HTMLBaseFontElement : HTMLElement {
attribute DOMString color;
attribute DOMString face;
attribute DOMString size;
};
colorfacesizeLocal change to font. See the FONT element definition in HTML 4.0. This element is deprecated in HTML 4.0.
interface HTMLFontElement : HTMLElement {
attribute DOMString color;
attribute DOMString face;
attribute DOMString size;
};
colorfacesizeCreate a horizontal rule. See the HR element definition in HTML 4.0.
interface HTMLHRElement : HTMLElement {
attribute DOMString align;
attribute boolean noShade;
attribute DOMString size;
attribute DOMString width;
};
alignnoShadesizewidthNotice of modification to part of a document. See the INS and DEL element definitions in HTML 4.0.
interface HTMLModElement : HTMLElement {
attribute DOMString cite;
attribute DOMString dateTime;
};
citedateTimeThe anchor element. See the A element definition in HTML 4.0.
interface HTMLAnchorElement : HTMLElement {
attribute DOMString accessKey;
attribute DOMString charset;
attribute DOMString coords;
attribute DOMString href;
attribute DOMString hreflang;
attribute DOMString name;
attribute DOMString rel;
attribute DOMString rev;
attribute DOMString shape;
attribute long tabIndex;
attribute DOMString target;
attribute DOMString type;
void blur();
void focus();
};
accessKeycharsetcoordsshape for the shape of the region. See the coords attribute definition
in HTML 4.0.hrefhreflangnamerelrevshapecoords. See the shape attribute definition
in HTML 4.0.tabIndextargettypeblurfocusEmbedded image. See the IMG element definition in HTML 4.0.
interface HTMLImageElement : HTMLElement {
attribute DOMString lowSrc;
attribute DOMString name;
attribute DOMString align;
attribute DOMString alt;
attribute DOMString border;
attribute DOMString height;
attribute DOMString hspace;
attribute boolean isMap;
attribute DOMString longDesc;
attribute DOMString src;
attribute DOMString useMap;
attribute DOMString vspace;
attribute DOMString width;
};
lowSrcnamealignaltborderheighthspaceisMaplongDescsrcuseMapvspacewidthGeneric 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.0.
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 DOMString hspace;
attribute DOMString name;
attribute DOMString standby;
attribute long tabIndex;
attribute DOMString type;
attribute DOMString useMap;
attribute DOMString vspace;
attribute DOMString width;
};
formFORM element containing this control.
Returns null if this control is not within the context of a form. codecode attribute for
HTMLAppletElement. alignarchivebordercodeBaseclassid, data, and
archive attributes. See the codebase attribute definition
in HTML 4.0.codeTypeclassid attribute. See the codetype attribute definition
in HTML 4.0.datadeclareheighthspacenamestandbytabIndextypedata attribute. See the type attribute definition
in HTML 4.0.useMapvspacewidthParameters fed to the OBJECT element. See the PARAM element definition
in HTML 4.0.
interface HTMLParamElement : HTMLElement {
attribute DOMString name;
attribute DOMString type;
attribute DOMString value;
attribute DOMString valueType;
};
nametypevalue attribute when
valuetype has the value "ref". See the type attribute definition
in HTML 4.0.valuevalueTypevalue attribute
value. See the valuetype attribute definition
in HTML 4.0.An embedded Java applet. See the APPLET element definition in HTML 4.0. This element is deprecated in HTML 4.0.
interface HTMLAppletElement : HTMLElement {
attribute DOMString align;
attribute DOMString alt;
attribute DOMString archive;
attribute DOMString code;
attribute DOMString codeBase;
attribute DOMString height;
attribute DOMString hspace;
attribute DOMString name;
attribute DOMString object;
attribute DOMString vspace;
attribute DOMString width;
};
alignaltarchivecodecodeBaseheighthspacenameobjectvspacewidthClient-side image map. See the MAP element definition in HTML 4.0.
interface HTMLMapElement : HTMLElement {
readonly attribute HTMLCollection areas;
attribute DOMString name;
};
areasnameusemap). See the name attribute definition
in HTML 4.0.Client-side image map area definition. See the AREA element definition in HTML 4.0.
interface HTMLAreaElement : HTMLElement {
attribute DOMString accessKey;
attribute DOMString alt;
attribute DOMString coords;
attribute DOMString href;
attribute boolean noHref;
attribute DOMString shape;
attribute long tabIndex;
attribute DOMString target;
};
accessKeyaltcoordsshape for the shape of the region. See the coords attribute definition
in HTML 4.0.hrefnoHrefshapecoords. See the shape attribute definition
in HTML 4.0.tabIndextargetScript statements. See the SCRIPT element definition in HTML 4.0.
interface HTMLScriptElement : HTMLElement {
attribute DOMString text;
attribute DOMString htmlFor;
attribute DOMString event;
attribute DOMString charset;
attribute boolean defer;
attribute DOMString src;
attribute DOMString type;
};
texthtmlForeventcharsetdefersrctypeThe create* and delete* methods on the table allow authors to construct
and modify tables. HTML 4.0 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.0.
interface HTMLTableElement : HTMLElement {
attribute HTMLTableCaptionElement caption;
attribute HTMLTableSectionElement tHead;
attribute HTMLTableSectionElement tFoot;
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();
HTMLElement insertRow(in long index);
void deleteRow(in long index);
};
captionCAPTION, or void if none exists. tHeadTHEAD, or
null if none exists.
tFootTFOOT, or
null if none exists.
rowsTHEAD, TFOOT, all
TBODY elements. tBodiesalignbgColorbordercellPaddingcellSpacingframerulessummarywidthcreateTHeadTHEAD).deleteTHeadcreateTFootTFOOT).deleteTFootcreateCaptionCAPTION element.deleteCaptioninsertRowindex |
The row number where to insert a new row. |
deleteRowindex |
The index of the row to be deleted. |
Table caption See the CAPTION element definition in HTML 4.0.
interface HTMLTableCaptionElement : HTMLElement {
attribute DOMString align;
};
alignRegroups the COL and COLGROUP elements. See the COL element definition
in HTML 4.0.
interface HTMLTableColElement : HTMLElement {
attribute DOMString align;
attribute DOMString ch;
attribute DOMString chOff;
attribute long span;
attribute DOMString vAlign;
attribute DOMString width;
};
alignchchOffspanvAlignwidthThe THEAD, TFOOT, and TBODY
elements.
interface HTMLTableSectionElement : HTMLElement {
attribute DOMString align;
attribute DOMString ch;
attribute DOMString chOff;
attribute DOMString vAlign;
readonly attribute HTMLCollection rows;
HTMLElement insertRow(in long index);
void deleteRow(in long index);
};
alignalign
attribute for HTMLTheadElement for details. chchOffvAlignvalign
attribute for HTMLTheadElement for details. rowsinsertRowindex |
The row number where to insert a new row. |
deleteRowindex |
The index of the row to be deleted. |
A row in a table. See the TR element definition in HTML 4.0.
interface HTMLTableRowElement : HTMLElement {
attribute long rowIndex;
attribute long sectionRowIndex;
attribute HTMLCollection cells;
attribute DOMString align;
attribute DOMString bgColor;
attribute DOMString ch;
attribute DOMString chOff;
attribute DOMString vAlign;
HTMLElement insertCell(in long index);
void deleteCell(in long index);
};
rowIndexsectionRowIndexTHEAD, TFOOT, or TBODY). cellsalignbgColorchchOffvAligninsertCellTD cell into this row.
index |
The place to insert the cell. |
deleteCellindex |
The index of the cell to delete. |
The object used to represent the TH and TD
elements. See the TD element definition
in HTML 4.0.
interface HTMLTableCellElement : HTMLElement {
attribute long cellIndex;
attribute DOMString abbr;
attribute DOMString align;
attribute DOMString axis;
attribute DOMString bgColor;
attribute DOMString ch;
attribute DOMString chOff;
attribute long colSpan;
attribute DOMString headers;
attribute DOMString height;
attribute boolean noWrap;
attribute long rowSpan;
attribute DOMString scope;
attribute DOMString vAlign;
attribute DOMString width;
};
cellIndexabbralignaxisbgColorchchOffcolSpanheadersid attribute values for header cells. See the headers attribute definition
in HTML 4.0.heightnoWraprowSpanscopevAlignwidthCreate a grid of frames. See the FRAMESET element definition in HTML 4.0.
interface HTMLFrameSetElement : HTMLElement {
attribute DOMString cols;
attribute DOMString rows;
};
colsrowsCreate a frame. See the FRAME element definition in HTML 4.0.
interface HTMLFrameElement : HTMLElement {
attribute DOMString frameBorder;
attribute DOMString longDesc;
attribute DOMString marginHeight;
attribute DOMString marginWidth;
attribute DOMString name;
attribute boolean noResize;
attribute DOMString scrolling;
attribute DOMString src;
};
frameBorderlongDescmarginHeightmarginWidthnametarget attribute). See the name attribute definition
in HTML 4.0.noResizescrollingsrcInline subwindows. See the IFRAME element definition in HTML 4.0.
interface HTMLIFrameElement : HTMLElement {
attribute DOMString align;
attribute DOMString frameBorder;
attribute DOMString height;
attribute DOMString longDesc;
attribute DOMString marginHeight;
attribute DOMString marginWidth;
attribute DOMString name;
attribute DOMString scrolling;
attribute DOMString src;
attribute DOMString width;
};
alignframeBorderheightlongDescmarginHeightmarginWidthnametarget attribute). See the name attribute definition
in HTML 4.0.scrollingsrcwidth