Javascript DOM HTML Input Reset disabled Property get

Introduction

Find out if a Reset button is disabled or not:

var x = document.getElementById("myReset").disabled;

Click the button to find out if the Reset button is disabled.

View in separate window

<!DOCTYPE html>
<html>
<body>

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

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

<script>
function myFunction() {//from   ww  w.  j a  v  a  2s  .  c o m
  var x = document.getElementById("myReset").disabled;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>



PreviousNext

Related