title: How to toggle class using pure javascript in html
body: <p>I have a <code>&lt;div&gt;</code>, and I want to toggle its classes on hover.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>function a(){
      this.classList.toggle('first');
      this.classList.toggle('sec');
  }
  document.querySelector('#container').addEventListener('click', a );
  </code></pre>
  
  <p>I know there is no problem in my html or css. It is just that I have to change and put something in place of <code>click</code>, but I don't know what. </p>
  
  <p>Please help!!</p>