title: How to make a button toggle display with click event listener?
body: <p>I have about 20 products, each product has a button and description box. I have looped through added a click event listener that displays the product description box once the button is clicked.</p>
  <p>How can I give the button the ability to hide the description box as well (i.e. toggle display)?</p>
  <p>Here is my code:</p>
  <pre><code>const descriptionBtn = document.querySelectorAll('.desc-btn');
  
  descriptionBtn.forEach((btn) =&gt; {
    btn.addEventListener('click', (e) =&gt; {
      descriptionBox = btn.nextElementSibling;
      descriptionBox.style.display = &quot;block&quot;;
    });
  });
  </code></pre>