Javascript DOM HTML Input Reset Disable and enable

Introduction

Disable and enable a reset button:

View in separate window

<!DOCTYPE html>
<html>
<body>

<input type="reset" id="myReset"><br>

<button onclick="disable()">Disable Reset Button</button>
<button onclick="enable()">enable Reset Button</button>

<script>
function disable() {//from   w  w w .j  av  a 2s .c  o  m
  document.getElementById("myReset").disabled = true;
}
function enable() {
  document.getElementById("myReset").disabled = false;
}
</script>

</body>
</html>



PreviousNext

Related