how to compare two elements in jquery [duplicate]

For the record, jQuery has an is() function for this:

a.is(b)

Note that a is already a jQuery instance.

Leave a Comment