Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML DOM isEqualNode() Method

XML DOM isEqualNode() Method


Element Object Reference Element Object


Definition and Usage

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

Syntax

elementObject.isEqualNode(node)

Parameters Description
node Required. The node to check.

Example

The following code snippet uses loadXMLDoc() to load "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 Object Reference Element Object