Compare jQuery DOM objects for equality


get(0) gives you a reference to the raw DOM element. Just adding this to help someone else in case this post gets googled it by someone.

var A = $('#divA');
var B = $('#divA');

if( A.get(0)===B.get(0) ){
    alert('A === B');
}
Advertisements