I\'d like to check ancestry using two jQuery objects. They don\'t have IDs, and are only going to be available as jQuery objects (or DOM nodes if you called get()
get()
Try this:
var someDiv = $('#div'); $('a').click(function() { if ($.inArray($(this).parents().get(), someDiv.get(0)) { alert('boo'); } }