title: CSS animation stops working after repeating it several times
body: <p>If you click repeatedly and very fast on the div it will stop doing the animation and the transform class won't get removed.
  this is the code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>let item = document.querySelector('.item');
  
  item.addEventListener('click', function(e) {
    item.classList.add('transform');
  });
  
  item.addEventListener('transitionend', function(e) {
    item.classList.remove('transform');
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>html,
  body {
    height: 100%;
    margin: 0;
    background-color: #0b0a10;
  }
  
  body {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .item {
    text-align: center;
    border: 3px solid white;
    font-size: 24px;
    color: white;
    padding: 16px;
    transition: 0.2s;
  }
  
  .transform {
    transform: scale(1.2);
    background-color: #fe960f;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;body&gt;
    &lt;div class="item"&gt;
      &lt;p&gt;1&lt;/p&gt;
    &lt;/div&gt;
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>How can I solve this and why does it happen?</p>