title: jQuery addClass working but javascript classList.add not working
body: <p>I am trying to add a class via javascript but it does not update in my DOM.
  When I use jQuery though everything works as expected.
  The issue is adding the svg--active class is not working.
  item.classList.add('tab-brackground--active') works.</p>
  <p>My jQuery code -</p>
  <pre><code>window.addEventListener('load', function () {
      const svg = document.querySelector('svg')
  
      if (svg) {
          const items = document.querySelectorAll(
              '.woocommerce-grouped-product-list-item'
          )
  
          if (items) {
              items.forEach((item) =&gt; {
                  item.addEventListener('mouseenter', (e) =&gt; {
                      item.classList.add('tab-brackground--active')
                      const text = e.target.children[0].innerText
                      jQuery(`[data-section=&quot;${text.toLowerCase()}&quot;]`).addClass(
                          'svg--active'
                      )
                  })
              })
          }
      }
  })
  </code></pre>
  <p>Same thing done with javascript that doesn't work -</p>
  <pre><code>window.addEventListener('load', function () {
      const svg = document.querySelector('svg')
  
      if (svg) {
          const items = document.querySelectorAll(
              '.woocommerce-grouped-product-list-item'
          )
  
          if (items) {
              items.forEach((item) =&gt; {
                  item.addEventListener('mouseenter', (e) =&gt; {
                      item.classList.add('tab-brackground--active')
                      const text = e.target.children[0].innerText
                      document.querySelector(`[data-section=&quot;${text.toLowerCase()}&quot;]`).classList.add(
                          'svg--active'
                      )
                  })
              })
          }
      }
  })
  </code></pre>
  <p>When I console.log my javascript element it shows the element with the class added but when I go to check the DOM the class is not added.</p>