How do I determine if two jQuery objects are equal? I would like to be able to search an array for a particular jQuery object.
$.inArray(jqobj, my_array);//-
The $.fn.equals(...) solution is probably the cleanest and most elegant one.
I have tried something quick and dirty like this:
JSON.stringify(a) == JSON.stringify(b)
It is probably expensive, but the comfortable thing is that it is implicitly recursive, while the elegant solution is not.
Just my 2 cents.