XML DOM isEqualNode()Methods


Element object

Definition and Usage

The isEqualNode() method returns true if the node is equal to the given node, otherwise it returns false.

Syntax

elementObject.isEqualNode(node)

Parameter Description
node Required. The node to check.


Example

The following code snippet usesloadXMLDoc()put "books.xml" Load into xmlDoc, and check whether the two nodes are equal:

xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.getElementsByTagName("book")[1];
y=xmlDoc.getElementsByTagName("book")[2];

document.write(x.isEqualNode(y));

Output:

false


Element objectother extensions