I\'m trying to come up with a reusable JS or jQuery function that would allow me to test if one object is a DOM descendant of another.
I\'ve seen a model of testing
In jQuery ancestors using jQuery objects I suggested
if ($(obj1).parents().index($(obj2)) >= 0) { // obj1 is a descendant of obj2 }