Checking equality of 2 DOM Elements
Check out the API for DOM nodes. It seems like you could use isEqualNode
to achieve this.
https://developer.mozilla.org/en-US/docs/Web/API/Node/isEqualNode
element1
and element2
are references to the same place in the DOM tree. Just check
if( element1 == element2 )
{
alert("same") ;
}