title: How to select all buttons with forEach in JS dom (no jQuery)
body: <p>I have 3 buttons having class name "btn";
  How can select all button by using addEventListener and forEach?
  I don't select one by one
  HTML codes:    </p>
  
  <pre><code>&lt;div class="display"&gt;
     &lt;input type="number" class="text"&gt;
  &lt;/div&gt;
  &lt;div class="buttons"&gt;
     &lt;input type="button" value="1" class="btn"&gt;
     &lt;input type="button" value="2" class="btn"&gt;
     &lt;input type="button" value="3" class="btn"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>JS code:</p>
  
  <pre><code>  const display = document.querySelector(".text"),
    btn = document.querySelectorAll(".btn");
  
    btn.addEventListener("click", buttons);
  
    function buttons() { 
     display.value = btn.value;
     };
  </code></pre>