How to disable and HTML button with JavaScript

1 Answer

0 votes
<!DOCTYPE html>
<html>
<body>

<form>
<input type="button" id="button_id" value="Button">
</form>
<br />

<button onclick="disableButton()">Disable Button</button>

<script>
function disableButton() {
  document.getElementById("button_id").disabled = true;
}
</script>

</body>
</html>

 



answered Jan 16, 2019 by avibootz
...