title: Add default class on jQuery
body: <p>I was working on my app and had this jQuery code that adds <code>active</code> class on current location which is working just fine.</p>
  
  <p>Now my problem is that I need to know how to set a default or I should say place the <code>active</code> class on <code>Home</code> link whenever there is no link selected or the URL is <code>http://localhost:3000/</code></p>
  
  <pre><code>var url = window.location.href;
  
  var link = window.location.hash
  $('a.ks-nav.active-menu').removeClass('active'); 
  
  $('a.ks-nav[data-id="' + link.replace('#', '') + '"]').addClass('active'); 
  </code></pre>
  
  <p>Here are my links:</p>
  
  <pre><code>&lt;a class="nav-link ks-nav" data-id="home" href="/#home"&gt;Home&lt;/a&gt;
  &lt;a class="nav-link ks-nav" data-id="about" href="/#about"&gt;About&lt;/a&gt;
  &lt;a class="nav-link ks-nav" data-id="contact" href="/#contact"&gt;Contact&lt;/a&gt;
  </code></pre>
  
  <p>How can I set a jQuery default code that adds the <code>active</code> class on <code>Home</code> whenever there are no setup <code>active</code> class on any of the available menu? This needs a deeper checking and make sure there are no other element that has the class cause basically when they click on a different menu the <code>Home</code> link must remove the <code>active</code> class and will go to that link URL / click menu.</p>
  
  <p>Please help!</p>