TOC PREV NEXT INDEX

domref


DOM Element Reference

This chapter provides a brief reference for all of the methods, properties, and events available to all HTML and XML elements in the Netscape 6 DOM.

These DOM interfaces cross the various specification levels, but tend to concentrate on the published DOM Level 2 HTML recommendation. Each member includes a link to the appropriate place in the W3C DOM specifications.

DOM Elements Interface


In this case, Elements refers to the interface that all HTML and XML elements have available to them from the DOM. There are more specialized interfaces for particular objects-the BODY element, for example, has extra functions and properties you can use, as do tables. This chapter refers to the interface that all elements share.

Properties

Returns an array of the attributes on the element.
Returns an array of the child nodes on the element.
Gets/sets the class of the element.
Gets/sets the directionality of the element.
Returns the first direct child of the current node.
Gets/sets the id of the current element.
innerHTML returns all of the markup and content within a given element.
Specifies the base language of an element's attribute values and text content.
Returns the last child of the current node.
Returns the number of items in a list (e.g. childNodes).
localName returns the local part of the qualified name of this node.
The namespace URI of this node, or NULL if it is unspecified.
Returns the node immediately following the current one in the tree.
Returns the name of the current node.
Returns the type of the current node.
Returns the value of the current node.
offsetHeight gets the number of pixels that the current element is offset within the offsetParent node
offsetLeft gets/sets the number of pixels that the current element is offset to the left within the offsetParent node.
offsetParent returns a reference to the object in which the current element is offset (i.e., the parent element).
offsetTop returns the position of the current element relative to the top of the offsetParent node.
offsetWidth gets the number of pixels that the current element is offset within the offsetParent node.
Returns the document in which this node appears.
Returns the parent node of the current node.
prefix returns the namespace prefix of the current node, or NULL if it is unspecified.
Returns the node immediately previous to the current one in the tree.
style returns the block of style rules on the current element.
Gets/sets the position of the element in the tabbing order.
tagName returns the name of the element.
title returns the title of the document.

Methods

addEventListener allows the registration of event listeners on the event target.
The appendChild method inserts the specified node into the list of nodes on the current document.
The blur method removes keyboard focus from the current element.
The click method excecutes a click on the current element.
The cloneNode method returns a duplicate of the current node.
The dispatchEvent method allows the dispatch of events into the implementation's event model.
focus sets focus on the current element.
getAttribute returns the value of the named attribute on the current node.
getAttributeNS returns the value of the attribute with the given name and namespace.
Returns the attribute of the current element as a separate node.
Returns the elements of a particular name that are children of the current element.
hasAttribute returns a boolean value indicating whether the current element has the specified attribute or not.
hasAttribute is a boolean value indicating whether the current element has an attribute with the specified name and namespace.
hasChildNodes is a boolean value indicating whether the current element has children or not.
The insertBefore method allows you to insert a node before the current element in the DOM.
The item method retrieves a node from the tree by index.
The normalize method puts the current node and all of its subtree into a "normalized" form (see below).
The removeAttribute() method removes an attribute from the current element.
removeAttributeNode removes the specified attribute from the current element.
The removeChild() method removes a child node from the current element.
removeEventListener() allows the removal of event listeners from the event target.
The replaceChild() method replaces one child node on the current element with another.
setAttribute adds a new attribute or changes the value of an existing attribute on the current element.
setAttributeNS adds a new attribute or changes the value of an attribute with the given namespace and name.
setAttributeNode adds a new attribute node to the current element.
The supports method tests if this DOM implementation supports a particular feature.

Event Handlers

These element properties cannot be assigned to in the way that the event handlers on the document and window objects can. All of the folllowing event handler properties are read-only, and are made to return the event handling code, if any, that has already been added to the element in the HTML or XML itself.

Returns the event handling code for the blur event.
Returns the event handling code for the click event.
Returns the event handling code for the dblclick event.
Returns the event handling code for the focus event.
Returns the event handling code for the keydown event.
Returns the event handling code for the keypress event.
Returns the event handling code for the keyup event.
Returns the event handling code for the mousedown event.
Returns the event handling code for the mousemove event.
Returns the event handling code for the mouseout event.
Returns the event handling code for the mouseover event.
Returns the event handling code for the mouseup event.
Returns the event handling code for the resize event.


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX