On Apr 17, 2:21 am, Rick <[email protected]> wrote:
> It would be nice to have a function to test for JQuery equality.

As previous discussed here:
http://groups.google.com/group/jquery-en/browse_thread/thread/002d7543186ddaa6

This is a bit cleaner and uses !== which is better than !=

$.fn.equals = function(compareTo) {
  if (!compareTo || !compareTo.length || this.length!
=compareTo.length) {
    return false;
  }
  for (var i=0; i<this.length; i++) {
    if (this[i]!==compareTo[i]) {
      return false;
    }
  }
  return true;
}

I'm still not quite sure why this would be useful.

Matt Kruse

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to