SyntaxFix
Write A Post
Hire A Developer
Questions
a.is(b)
and to check if they are not equal use
!a.is(b)
as for
$b = $('#a') .... $('#a')[0] == $b[0] // not always true
maybe class added to the element or removed from it after the first assignment