Input Number disabled Property - Find out if a number field is disabled - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Number

Description

Input Number disabled Property - Find out if a number field is disabled

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="number" id="myNumber" value="2" disabled>

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

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

<script>
function myFunction() {/*from  w  w  w  .ja  v  a2  s  .  c o m*/
    var x = document.getElementById("myNumber").disabled;
    document.getElementById("demo").innerHTML = x;
}
</script>

</body>
</html>

Related Tutorials