Input Number stepUp() Method - Increment the value of a number field by 1 (default): - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Number

Description

Input Number stepUp() Method - Increment the value of a number field by 1 (default):

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>
Number: <input type="number" id="myNumber">

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

<script>
function myFunction() {/*from w  w w.j  av  a2s . com*/
    document.getElementById("myNumber").stepUp();
}
</script>

</body>
</html>

Related Tutorials