title: How to add active class on click and remove active on click
body: <p>I am creating accordian menu with simple js. How can I add and remove active class on click open/close?</p>
  
  <pre><code>&lt;div class="mobile-categories"&gt;
      &lt;h4 class="mcategory-toggle"&gt;Vehicles&lt;/h4&gt;
      &lt;ul class="msub-categories"&gt;
          &lt;li&gt;Option 1&lt;/li&gt;
          &lt;li&gt;Option 2&lt;/li&gt;
          &lt;li&gt;Option 3&lt;/li&gt;
      &lt;/ul&gt;
      &lt;h4 class="mcategory-toggle"&gt;Education&lt;/h4&gt;
      &lt;ul class="msub-categories"&gt;
          &lt;li&gt;Option 10&lt;/li&gt;
          &lt;li&gt;Option 20&lt;/li&gt;
          &lt;li&gt;Option 30&lt;/li&gt;
      &lt;/ul&gt;
      &lt;h4 class="mcategory-toggle"&gt;Shops&lt;/h4&gt;
      &lt;ul class="msub-categories"&gt;
          &lt;li&gt;Option 14&lt;/li&gt;
          &lt;li&gt;Option 25&lt;/li&gt;
          &lt;li&gt;Option 36&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>a <a href="http://jsfiddle.net/h0jc50ye/3/" rel="nofollow">fiddle</a></p>