As someone already said, the same HTML element wrapped in two different moments generates two different jQuery instances, so they can never be equal.
Instead, wrapped HTML elements can be compared in this way, since their location in memory is the same if it is the same HTML element, therefore:
var LIs = $('#myUL LI'); var $match = $('#myUL').find('LI:first'); alert(LIs.eq(0) === $match); // false alert(LIs.get(0) === $match.get(0)) // TRUE! yeah :)
Respectfully!
Emanuele Del Grande Mar 08 2018-11-11T00: 00Z
source share