how to compare two elements in jquery [duplicate] November 22, 2022 by Tarik For the record, jQuery has an is() function for this: a.is(b) Note that a is already a jQuery instance.