This page is Ready to Use

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

isEqualNode

Summary

Determines whether two nodes are equal in their type, name and namespace.

Method of dom/Nodedom/Node

Syntax

var isEqual = node.isEqualNode(/* see parameter list */);

Parameters

otherNode

Data-type
DOM Node

The node to be compared to the node that is executing the method.

Return Value

Returns an object of type BooleanBoolean

Whether the node specified in the otherNode parameter is equal to the current node.

Examples

In the follow example if #targetElm is the first div element of the document ‘true’ will be displayed.

var targetElm = document.getElementById("targetElm");
var firstDiv = document.getElementsByTagName("div")[0];

alert( targetElm.isEqualNode(firstDiv) );

Usage

 This method determines whether or not two nodes are equal.  Nodes are considered equal when the values of the following attributes are equal:

Notes

Nodes can be equal without being the same. Use isSameNode to determine if two nodes are the same.

Related specifications

DOM Level 3 Core
Recommendation

Attributions