Javascript DOM HTML Input Week disabled Property get

Introduction

Find out if a week field is disabled or not:

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

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

input elements with type="week" are not supported in Internet Explorer or Firefox.

View in separate window

<!DOCTYPE html>
<html>
<body>

<input type="week" id="myWeek" disabled>

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


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

<script>
function myFunction() {//  w  ww  . ja  v a2s  .c  o  m
  var x = document.getElementById("myWeek").disabled;
  document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>



PreviousNext

Related