Javascript examples for DOM HTML Element:Input Number
Input Number max Property - Change the maximum value:
<!DOCTYPE html> <html> <body> Quantity:/* w ww. ja v a 2 s. c om*/ <input type="number" id="myNumber" min="1" max="5"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myNumber").max = "10"; document.getElementById("demo").innerHTML = "The value of the max attribute was changed from '5' to '10'."; } </script> </body> </html>