Javascript DOM HTML Input Time disabled Property get

Introduction

Find out if a time field is disabled or not:

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

Click the button to find out if the time field is disabled.

View in separate window

<!DOCTYPE html>
<html>
<body>

<input type="time" id="myTime" disabled>
<button onclick="myFunction()">Test</button>

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

<script>
function myFunction() {/* w  w  w  .  j a va2 s  . c om*/
  var x = document.getElementById("myTime").disabled;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>



PreviousNext

Related