title: Disabling multiple HTML buttons
body: <p>I have multiple buttons <code>name="angka"</code> and <code>id="angka"</code>:</p>
  
  <pre><code>&lt;input type="button" name="angka" id="angka" value="1" style="width:15px" onclick="insert(1)"&gt;
  &lt;input type="button" name="angka" id="angka" value="2" style="width:15px" onclick="insert(2)"&gt;
  &lt;input type="button" name="angka" id="angka" value="3" style="width:15px" onclick="insert(3)"&gt;
  </code></pre>
  
  <p><code>onLoadPage</code> event I try to disabled them with the below code.</p>
  
  <pre><code>document.getElementById("operator").disabled = true; 
  document.getElementsByName("operator").disabled = true; 
  </code></pre>
  
  <p>But the result is that only the first button is disabled, the other buttons are still enabled.</p>
  
  <p>How to disable the buttons with JavaScript without making unique names or ids?</p>
  
  <p>solve with </p>
  
  <pre><code>`var elements = document.getElementsByClassName("classname");
  
  for (var i = 0; i &lt; elements.length; i++) {
    elements[i].disabled =true;
  }`
  </code></pre>