开发者

how to setting time in jquery?

i'm newbie at web developing. i have some input form.i'm using jquery 1.4.2 inside that i have one textfield specially for input time. i want eve开发者_开发技巧ry one no need to type manually. and also make easy for every user. can you tell me how do i do that?


It sounds like you're after a better UI way to go about this. There are many more date than time widgets out there, but there are time pickers available, my personal favorite is this here: jQuery.timepicker, give it a look.

It's jquery UI Themeable, and if you need a more specific time you can still type in the box, so it works both ways :)


Say in your HTML you have:

<input id='intime' type='text' name='intime'>

Then you can set it with:

$('#intime').val(new Date());


Use the Date Object. See "15.9.2 The Date Constructor Called as a Function" in the ECMAScript standard for more info.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜