小编pri*_*nce的帖子

如何使用jquery为时间字符串添加分钟和小时

我想在我的变量中添加30分钟然后一小时,我已经有了自己的日期

var initialDate = '10:00';
Run Code Online (Sandbox Code Playgroud)

所以

if (some condition){
    // i add 30 minutes ->10:30
}elseif(another condition){
    // i add 1hour ->11:00
}
Run Code Online (Sandbox Code Playgroud)

我尝试了这个但是没有用

var initialDate = '10:00';
var theAdd = new Date(initialDate);
var finalDate = theAdd.setMinutes(theAdd.getMinutes() + 30);
Run Code Online (Sandbox Code Playgroud)

javascript time jquery strtotime

4
推荐指数
2
解决办法
9156
查看次数

我想要一个隐藏数字的输入

可以在我的输入中包含这些条件吗?:

1-仅允许输入数字.

2-这些数字像密码一样隐藏.

3-在移动浏览器上弹出的数字键盘,而不是普通键盘.

4-所有这些都希望与浏览器兼容.

<input type="number" name="pin-code">
Run Code Online (Sandbox Code Playgroud)

javascript passwords jquery html5 input

2
推荐指数
1
解决办法
54
查看次数

标签 统计

javascript ×2

jquery ×2

html5 ×1

input ×1

passwords ×1

strtotime ×1

time ×1