Quickly: (function($){
jQuery.fn.equals = function(selector) { return $(this).get(0)==$(selector).get(0); }; })(jQuery); Implementation Example: ... <main> <div id='id0'></div> <div id='id1'></div> <ul id='id2'></ul> </main> ... $('#id0').equals('#id1') //false $('div').equals('#id0') //true $('div:eq(1)').equals('#id1') //true $('#id0').equals('#id2') //false Explaining: Since this is almost obvious will explain if someone asks. Ask please ;)