Element : Node
Return to: HTML DOM Level 3 index

Inherited Properties

Property Action Mozilla Safari Chrome Opera
baseURI : DOMString
The absolute base URI of this node or null if the implementation wasn't able to obtain an absolute URI. This value is computed as described in Base URIs. However, when the Document supports the feature "HTML" [DOM Level 2 HTML], the base URI is computed using first the value of the href attribute of the HTML BASE element if any, and the value of the documentURI attribute from the Document interface otherwise.
No Details 1.8.1+ 1.0+ no no
textContent : DOMString
This attribute returns the text content of this node and its descendants. When it is defined to be null, setting it has no effect. On setting, any possible children this node may have are removed and, if it the new string is not empty or null, replaced by a single Text node containing the string this attribute is set to. On getting, no serialization is performed, the returned string does not contain any markup. No whitespace normalization is performed and the returned string does not contain the white spaces in element content (see the attribute Text.isElementContentWhitespace). Similarly, on setting, no parsing is performed either, the input string is taken as pure textual content. The string returned is made of the text content of this node depending on its type, as defined below: ELEMENT_NODE, ATTRIBUTE_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, DOCUMENT_FRAGMENT_NODE concatenation of the textContent attribute value of every child node, excluding COMMENT_NODE and PROCESSING_INSTRUCTION_NODE nodes. This is the empty string if the node has no children. TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE, PROCESSING_INSTRUCTION_NODE nodeValue DOCUMENT_NODE, DOCUMENT_TYPE_NODE, NOTATION_NODE null
No Details 1.8.1+ 1.0+ no no

Properties

Property Action Mozilla Safari Chrome Opera
schemaTypeInfo : TypeInfo
The type information associated with this element.
No Details

Inherited Functions

Method Action Mozilla Safari Chrome Opera
compareDocumentPosition(Node otherNode) : Number
Compares the reference node, i.e. the node on which this method is being called, with a node, i.e. the one passed as a parameter, with regard to their position in the document and according to the document order.
Show Details

Parameters
Node otherNode The node to compare against the reference node.

Returns
Number

Throws
NOT_SUPPORTED_ERR: when the compared nodes are from different DOM implementations that do not coordinate to return consistent implementation-specific results.
Availability

HTML DOM Level 3|W3C

getFeature(DOMString feature, DOMString version) : DOMObject
This method returns a specialized object which implements the specialized APIs of the specified feature and version, as specified in DOM Features. The specialized object may also be obtained by using binding-specific casting methods but is not necessarily expected to, as discussed in Mixed DOM Implementations. This method also allows the implementation to provide specialized objects which do not support the Node interface.
Show Details

Parameters
DOMString feature The name of the feature requested. Note that any plus sign "+" prepended to the name of the feature will be ignored since it is not significant in the context of this method.
DOMString version The version number of the feature to test.

Returns
DOMObject

Availability

HTML DOM Level 3|W3C

getUserData(DOMString key) : DOMUserData
Retrieves the object associated to a key on a this node. The object must first have been set to this node by calling setUserData with the same key.
Show Details

Parameters
DOMString key The key the object is associated to.

Returns
DOMUserData

Availability

HTML DOM Level 3|W3C

insertBefore() : Node
Show Details

Returns
Node

Throws
HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself, or if this node is of type Document and the DOM application attempts to insert a second DocumentType or Element node.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly or if the parent of the node being inserted is readonly.
NOT_FOUND_ERR: Raised if refChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node is of type Document, this exception might be raised if the DOM implementation doesn't support the insertion of a DocumentType or Element node.
Availability

HTML DOM Level 3|W3C

isDefaultNamespace(DOMString namespaceURI) : boolean
Checks whether the specified namespaceURI is the default namespace.
Show Details

Parameters
DOMString namespaceURI The namespace URI to look for.

Returns
boolean

Availability

HTML DOM Level 3|W3C

isEqualNode(Node otherNode) : boolean
Tests whether two nodes are equal. This method tests for equality of nodes, not sameness (i.e., whether the two nodes are references to the same object) which can be tested with Node.isSameNode(). All nodes that are the same will also be equal, though the reverse may not be true. Two nodes are equal if and only if the following conditions are satisfied: * The two nodes are of the same type. * The following string attributes are equal: nodeName, localName, namespaceURI, prefix, nodeValue. This is: they are both null, or they have the same length and are character for character identical. * The attributes NamedNodeMaps are equal. This is: they are both null, or they have the same length and for each node that exists in one map there is a node that exists in the other map and is equal, although not necessarily at the same index. * The childNodes NodeLists are equal. This is: they are both null, or they have the same length and contain equal nodes at the same index. Note that normalization can affect equality; to avoid this, nodes should be normalized before being compared. For two DocumentType nodes to be equal, the following conditions must also be satisfied: * The following string attributes are equal: publicId, systemId, internalSubset. * The entities NamedNodeMaps are equal. * The notations NamedNodeMaps are equal. On the other hand, the following do not affect equality: the ownerDocument, baseURI, and parentNode attributes, the specified attribute for Attr nodes, the schemaTypeInfo attribute for Attr and Element nodes, the Text.isElementContentWhitespace attribute for Text nodes, as well as any user data or event listeners registered on the nodes. Note: As a general rule, anything not mentioned in the description above is not significant in consideration of equality checking. Note that future versions of this specification may take into account more attributes and implementations conform to this specification are expected to be updated accordingly.
Show Details

Parameters
Node otherNode The node to compare equality with.

Returns
boolean

Availability

HTML DOM Level 3|W3C

isSameNode(Node otherNode) : boolean
Returns whether this node is the same node as the given one. This method provides a way to determine whether two Node references returned by the implementation reference the same object. When two Node references are references to the same object, even if through a proxy, the references may be used completely interchangeably, such that all attributes have the same values and calling the same DOM method on either reference always has exactly the same effect.
Show Details

Parameters
Node otherNode The node to test against.

Returns
boolean

Availability

HTML DOM Level 3|W3C

lookupNamespaceURI([DOMString prefix]) : DOMString
Look up the namespace URI associated to the given prefix, starting from this node.
Show Details

Parameters
DOMString prefix (optional)The prefix to look for. If this parameter is null, the method will return the default namespace URI if any.

Returns
DOMString

Availability

HTML DOM Level 3|W3C

lookupPrefix(DOMString namespaceURI) : DOMString
Look up the prefix associated to the given namespace URI, starting from this node. The default namespace declarations are ignored by this method.
Show Details

Parameters
DOMString namespaceURI The namespace URI to look for.

Returns
DOMString

Availability

HTML DOM Level 3|W3C

normalize() : void
Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes. This can be used to ensure that the DOM view of a document is the same as if it were saved and re-loaded, and is useful when operations (such as XPointer [XPointer] lookups) that depend on a particular document tree structure are to be used. If the parameter "normalize-characters" of the DOMConfiguration object attached to the Node.ownerDocument is true, this method will also fully normalize the characters of the Text nodes.
Show Details
Availability

HTML DOM Level 3|W3C

setUserData(DOMString key, [DOMUserData userData]) : DOMString
Associate an object to a key on this node. The object can later be retrieved from this node by calling getUserData with the same key.
Show Details

Parameters
DOMString key The key with which to associate the object.
DOMUserData userData (optional)The object to associate to the given key, or null to remove any existing association to that key.

Returns
DOMString

Availability

HTML DOM Level 3|W3C

Functions

Method Action Mozilla Safari Chrome Opera
setIdAttribute(DOMString name, boolean isId) : void
If the parameter isId is true, this method declares the specified attribute to be a user-determined ID attribute. This affects the value of Attr.isId and the behavior of Document.getElementById, but does not change any schema that may be in use, in particular this does not affect the Attr.schemaTypeInfo of the specified Attr node. Use the value false for the parameter isId to undeclare an attribute for being a user-determined ID attribute. To specify an attribute by local name and namespace URI, use the setIdAttributeNS method.
Show Details

Parameters
DOMString name The name of the attribute.
boolean isId Whether the attribute is a of type ID.

Throws
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if the specified node is not an attribute of this element.
Availability

HTML DOM Level 3|W3C

setIdAttributeNS(DOMString namespaceURI, DOMString localName, boolean isId) : void
If the parameter isId is true, this method declares the specified attribute to be a user-determined ID attribute. This affects the value of Attr.isId and the behavior of Document.getElementById, but does not change any schema that may be in use, in particular this does not affect the Attr.schemaTypeInfo of the specified Attr node. Use the value false for the parameter isId to undeclare an attribute for being a user-determined ID attribute.
Show Details

Parameters
DOMString namespaceURI The namespace URI of the attribute.
DOMString localName The local name of the attribute.
boolean isId Whether the attribute is a of type ID.

Throws
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if the specified node is not an attribute of this element.
Availability

HTML DOM Level 3|W3C

setIdAttributeNode(Attr idAttr, boolean isId) : void
If the parameter isId is true, this method declares the specified attribute to be a user-determined ID attribute. This affects the value of Attr.isId and the behavior of Document.getElementById, but does not change any schema that may be in use, in particular this does not affect the Attr.schemaTypeInfo of the specified Attr node. Use the value false for the parameter isId to undeclare an attribute for being a user-determined ID attribute.
Show Details

Parameters
Attr idAttr The attribute node.
boolean isId Whether the attribute is a of type ID.

Throws
NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
NOT_FOUND_ERR: Raised if the specified node is not an attribute of this element.
Availability

HTML DOM Level 3|W3C

text_javascript aptana_docs