title: Javascript/Jquery to change class onclick?
body: <p>I want to change a class onclick. What I have at the moment:</p>
  
  <pre><code>&lt;script&gt;
  function changeclass() {
  
  var NAME = document.getElementById("myclass")
  
  NAME.className="mynewclass"
  
  } 
  &lt;/script&gt;
  </code></pre>
  
  <p>But, ofcourse, its not working. Also, it should revert to previuos state onclick again.</p>
  
  <p>My html:</p>
  
  <pre><code>&lt;div id="showhide" class="meta-info" onclick="changeclass();"&gt;
  </code></pre>
  
  <p>So, whenever I press on #showhide myclass should change to mynewclass. Thanks for help in advance!</p>