Input Week stepUp() 方法

定义和用法

stepUp() 方法将星期字段的值增加指定的数字。

此方法只会对星期(而不是年)产生影响。

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

实例

例子 1

将星期字段的值增加 10 周:

document.getElementById("myWeek").stepUp(10);

亲自试一试

例子 2

将周数增加 1(默认):

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

亲自试一试

语法

weekObject.stepUp(number)

参数值

参数 描述
number

Required. Specifies the number of weeks to increase the week field.

If omitted, the week number 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

Note:In Safari, you must enter the week field first, then you can increase the value.