Javascript examples for DOM HTML Element:Input Number
Input Number step Property - Change the legal number intervals for a number field:
<!DOCTYPE html> <html> <body> Number:/*from w ww. j a va 2 s . c o m*/ <input type="number" id="myNumber" step="3"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myNumber").step = "5"; document.getElementById("demo").innerHTML = "The value of the step attribute was changed from '3' to '5'."; } </script> </body> </html>