title: Change class onClick using jquery
body: <p>I have a navigation that shows an active state using class="active".  When a link is clicked, I need to add the "active" class to to the clicked link, and remove the "active" class from all other links.</p>
  
  <p>Here's my code: </p>
  
  <pre><code>&lt;div id="referNav"&gt;
  &lt;div id="referLink1"&gt;&lt;a href="javascript:;" onClick="changeClass();" class="active"&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;div id="referLink2"&gt;&lt;a href="javascript:;" onClick="changeClass();" class=""&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;div id="referLink3"&gt;&lt;a href="javascript:;" onClick="changeClass();" class=""&gt;&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Any help would be greatly appreciated!</p>