开发者

Mask input for time(`01:55`)

I want mack a mask input for time(01:55) without use plugin,as only accept to user typed four number, (i mean, when user type number 01 put after it this : and next user type 55), how is it?

This is my code that not work:

<input name="text" class="time">


$('.time').live('keyup change',function(){
    this.value = this.value.replace(^[0-1]?[0-9]{1}:[0-5]{1}[0-9]{1}, "")
});

Here is full code: http://jsfiddl开发者_如何学Ce.net/yGLsH/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜