Bug Tracker

Modify

Ticket #2929 (closed feature: duplicate)

Opened 6 years ago

Last modified 2 years ago

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:
Blocking: Blocked by:

Description

It would be really useful if jQuery.is 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.

Change History

comment:1 Changed 6 years ago by flesler

You can use:

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

comment:2 Changed 5 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to duplicate

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

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.