Programmer's Guide > Interfaces > W3C Node interface > isEqualNode method
  
isEqualNode method
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, baseURI. This is: they are both null, or they have the same length and are character for character identical.
The attributesNamedNodeMaps 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 childNodesNodeLists 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 entitiesNamedNodeMaps are equal.
The notationsNamedNodeMaps are equal.
On the other hand, the following do not affect equality: the ownerDocument attribute, the specified attribute for Attr nodes, the isWhitespaceInElementContent attribute for Text nodes, as well as any user data or event listeners registered on the nodes.
isEqualNode(arg )
Parameters
Nodearg
The node to compare equality with.
Returns
boolean. Returns true if the nodes are equal, false otherwise.