title: If hasClass then addClass to parent
body: <p><strong>Original post:</strong>
  Why doesn't this simple script work?</p>
  
  <pre><code>if ($('#navigation &gt; ul &gt; li &gt; ul &gt; li &gt; a').hasClass('.active')) {
      $(this).parent().parent().parent().addClass(".active");
  }
  </code></pre>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This won't hide the H1:</p>
  
  <pre><code>if ($('#content h1').hasClass('aktiv')) {
      $(this).hide();
  }
  </code></pre>
  
  <p>Only this will:</p>
  
  <pre><code>if ($('#content h1').hasClass('aktiv')) {
      $('#content h1').hide();
  }
  </code></pre>
  
  <p>Why can't I use the (this)? </p>