title: if hasclass addclass else removeclass not working
body: <p>This is my markup</p>
  
  <pre><code>&lt;header id="header"&gt;
      &lt;nav&gt;
          &lt;ul class="menu"&gt;
              &lt;li id="homeSecLink" class="active"&gt;&lt;a href="#Home" class="homeLink"&gt;Home&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#Partners"&gt;Partners&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#About"&gt;About&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="#Contact"&gt;Contact&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/nav&gt;
  &lt;/header&gt;
  </code></pre>
  
  <p>On page load I am trying to add class <code>borderGap</code> on header if <code>homeSecLink</code> has <code>active</code> class else remove <code>borderGap</code></p>
  
  <p>Here <code>addClass</code> working but <code>removeClass</code> not working</p>
  
  <p>This is what I have done:</p>
  
  <pre><code>$(document).ready(function() {
      if ($('#homeSecLink').hasClass("active")) {
          $('#header').addClass('borderGap');
      } else {
          $('#header').removeClass('borderGap');
      }
  });
  </code></pre>