Skip to main content

Bug Tracker

Side navigation

#2929 closed feature (duplicate)

Opened May 23, 2008 02:23PM UTC

Closed January 31, 2009 05:09PM UTC

Last modified March 14, 2012 10:11PM UTC

Comparing DOM elements and/or jQuery objects for equality

Reported by: pfm102 Owned by:
Priority: major Milestone: 1.3
Component: core Version: 1.2.5
Keywords: Cc:
Blocked by: Blocking:

It would be really useful if could be passed a DOM element, and then returns true if the DOM element is equal to the single DOM element in the jQuery array.

Similarly, it would be handy to be able to do .equals to compare two jQuery arrays.

Attachments (0)
Change History (2)

Changed May 23, 2008 04:10PM UTC by flesler comment:1

You can use:

  $('html,body').index( document.body ) != -1;
or even
  $('html,body').index( $('body') ) != -1;

Changed January 31, 2009 05:09PM UTC by dmethvin comment:2

resolution: → duplicate
status: newclosed

This is a dup of #2773 which also has a patch to {{{.is()}}.