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

Javascript examples for DOM HTML Element:Input Number

Description

Input Number stepDown() Method - Decrement 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() {/*  w w  w.ja  va 2s .c  o  m*/
    document.getElementById("myNumber").stepDown();
}
</script>

</body>
</html>

Related Tutorials