Input Month stepUp() 方法

定义和用法

stepDown() 方法将月份字段的值增加指定的数字。

此方法只会影响月(而不是年)。

提示:如需减小值,请使用 stepDown() 方法

实例

例子 1

将月份字段的值增加 3 个月:

document.getElementById("myMonth").stepUp(3);

亲自试一试

例子 2

将月份字段的值增加 1(默认):

document.getElementById("myMonth").stepUp();

亲自试一试

语法

numberObject.stepDown()number)

Parameter value

Parameter Description
number

Required. Specifies the number of months to increase the month field.

If omitted, the month is increased by "1".

Technical details

Return value:

No return value.

Browser support

The numbers in the table indicate the first browser version that fully supports this property.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Supported 12.0 Not supported Supported Supported