Retrieve navigation class name on page load jQuery
<p>I have a list of links that link to sections within the page using anchor tags. I'm trying to grab the current class name initially when the user loads the page and add the class of "active" to the list item. So for instance, if a user goes to www.mydomain.com/#about-section, the navigation will remove the existing 'active' class and then add the class to the current link.</p>

<pre><code> &lt;nav id="primary"&gt;
    &lt;ul&gt;
      &lt;li class="active"&gt;&lt;a href="#intro-section"&gt;Home&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#work-section"&gt;Work&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#about-section"&gt;About&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="#contact-section"&gt;Contact&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/nav&gt;
</code></pre>

<p>How would I go about changing the class depending on which section is in view using jQuery?</p>
