 <p>Use:</p> <pre><code>$('.container .post .like').not('.liked').on('click', function() { // this gets fired even if the element has class "liked" }); </code></pre> <p>Or, </p> <pre><code>$('.container .post .like :not(".liked")').on('click', function() // ^^^ space between not selector { // this gets fired even if the element has class "liked" }); </code></pre>