title: how to add javascript function to a class of active?
body: <p>how to add javascript function to a class of active ??
  I do not understand completely about javascript.</p>
  
  <p>if i click menu its like remove and add new class nav active.</p>
  
  <pre class="lang-html prettyprint-override"><code>  &lt;div id="sidebar"&gt;        
      &lt;ul id="mainNav"&gt;           
              &lt;li id="navDashboard" class="nav active"&gt;
                &lt;span class="icon-home"&gt;&lt;/span&gt;
                 &lt;a href="&lt;?php echo site_url('admin/admin');?&gt;"&gt;Beranda&lt;/a&gt;              
              &lt;/li&gt;
  
          &lt;li id="navPages" class="nav"&gt;
          &lt;span class="icon-document-alt-stroke"&gt;&lt;/span&gt;
          &lt;a href="javascript:;"&gt;Data Profil&lt;/a&gt;              
  
          &lt;ul class="subNav"&gt;
                      &lt;li&gt;&lt;a href="&lt;?php echo site_url('admin/lokasi');?&gt;"&gt;Peta Lokasi&lt;/a&gt;&lt;/li&gt;
                      &lt;li&gt;&lt;a href="&lt;?php echo site_url('admin/siteplan');?&gt;"&gt;Site Plan&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
  
          &lt;/li&gt;
  </code></pre>