onclick check if that element not hasClass()
<p>I want to check on click that div or li any element not <code>hasClass()</code> then do something.</p>

<p>I am trying to do it like this:</p>

<pre><code>$(document).on('click',function() {
    if(!(this).hasClass("help-icons") &amp;&amp; !(this).hasClass("help") &amp;&amp; (this).hasClass("close")){
    $(".help-icons").hide();
    }else if((this).hasClass("help")){
        $(".help-icons").show();
     }else{
       $(".help-icons").hide();
     }
    });
</code></pre>