title: How to disable HTML button on the click using Javascript?
body: <p>Once my button gets clicked, it should get disabled and never be clicked again until the page is refreshed. Below is my code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function myButtonClicked()
  {
      alert("Has myButton got disabled? I need solution for this.");
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;button type="button" id="myButton1" onclick="myButtonClicked()"&gt;Click ME&lt;/button&gt;
  &lt;button type="button" id="myButton2" onclick="myButtonClicked()"&gt;Click ME&lt;/button&gt;
  &lt;button type="button" id="myButton3" onclick="myButtonClicked()"&gt;Click ME&lt;/button&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Before calling myButtonClicked function, it should get disabled. Actually, I want to write a PHP script in this function which will fetch some data from database which will take some time in real environment. That is why I want to disable the button. How do I achieve that?</p>