How to make button unclickable in JavaScript

To make a button not clickable, simply change it to disabled.

element.disabled = true;

Example:

<button id="myButton">My Button</button>

<script>
  document.getElementById("myButton").disabled = true; 
</script>

Output: