Input Number stepUp() Method
Example
Increment the value of a number field by 5:
document.getElementById("myNumber").stepUp(5);
Try it yourself »
Definition and Usage
The stepUp() method increments the value of the number field by a specified number.
Tip: To decrement the value, use the stepDown() method.
Browser Support
The stepUp() method is supported in all major browsers, except Internet Explorer.
Note: In Safari, you must enter a number in the number field before you can increment the value.
Syntax
numberObject.stepUp(number)
Parameter Values
Parameter | Description |
---|---|
number | Required. Specifies the amount the value of the
number field should increase. If omitted, the numbers are incremented by "1" |
Technical Details
Return Value: | No return value |
---|
More Examples
Example
Increment the value of a number field by 1 (default):
document.getElementById("myNumber").stepUp();
Try it yourself »
Input Number Object