Input Number min Property - Change the minimum value: - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Number

Description

Input Number min Property - Change the minimum value:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Quantity:/*  www.j  a v  a  2  s  .  c  o m*/
<input type="number" id="myNumber" min="1" max="10">

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

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

<script>
function myFunction() {
    document.getElementById("myNumber").min = "5";
    document.getElementById("demo").innerHTML = "The value of the min attribute was changed from '1' to '5'.";
}
</script>

</body>
</html>

Related Tutorials