jquery中如何设置时间?

发布于 2024-09-14 08:32:30 字数 123 浏览 0 评论 0原文

我是网络开发新手。 我有一些输入表单。我正在使用 jquery 1.4.2 其中我有一个专门用于输入时间的文本字段。 我希望每个人都不需要手动打字。 并且也让每个用户都可以轻松使用。 你能告诉我该怎么做吗?

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 every one no need to type manually.
and also make easy for every user.
can you tell me how do i do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

七婞 2024-09-21 08:32:37

使用日期对象。请参阅 ECMAScript 标准了解更多信息。

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

像极了他 2024-09-21 08:32:36

在你的 HTML 中说你有:

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

然后你可以设置它:

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

Say in your HTML you have:

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

Then you can set it with:

$('#intime').val(new Date());
谜兔 2024-09-21 08:32:34

听起来您正在寻求一种更好的 UI 方式来解决此问题。那里有比时间小部件更多的日期,但是有可用的时间选择器,我个人最喜欢的是这里:jQuery.timepicker,看看吧。

它是 jquery UI 主题,如果您需要更具体的时间,您仍然可以在框中键入,因此它是双向的:)

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 :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文