jQuery opposite of .hasClass()? December 18, 2023 by Tarik Why not simply: if (!el.hasClass('foo')) { // code }