Javascript DOM HTML Input Color disabled Property get

Introduction

Find out if a color picker is disabled or not:

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

Click button to find out if the color picker is disabled.

View in separate window

<!DOCTYPE html>
<html>
<body>
<input type="color" id="myColor" disabled>
<button onclick="myFunction()">Test</button>
<p id="demo"></p>

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

</body>
</html>



PreviousNext

Related