新的Date()问题 [英] new Date() problem

查看:43
本文介绍了新的Date()问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我在JS中使用新的Date()对象时遇到了一些问题。我可以让它工作得很好,但是,我不希望.getDay()返回一个数字。我开始创建一个星期几的数组,但我不知道如何使用它,所以我从代码中删除了它。我正在尝试用JS制作一个闹钟。

我会将我的代码放在两个单独的实例中,一个用于HTML,另一个用于我的.js文件。


JS

Hi all. I''m having a little bit of a problem with the new Date() object in JS. I can get it to work just fine, however, I don''t want the .getDay() to return a number. I started to create an array with the days of the week, but I wasn''t sure how to use it, so I removed it from my code. I''m trying to make an alarm clock with JS.
I''ll put my code in two separate instances, one for HTML and one for my .js file.

JS

展开 | 选择 | Wrap | 行号

推荐答案

没关系......我找到了相关文档如何解决它...但我有一个新问题。有没有人知道如何打开Windows目录菜单,就像你可以使用具有上传按钮的网站?或者我可以找到相关文档?
Never mind... I found the documentation on how to fix it... But I have a new problem. Does anyone know how to open a Windows directory menu like you can with websites that have upload buttons? Or where I can find documentation on that?


@ risk32


查看HTML输入元素。

@risk32
Check out the HTML ''input'' element.

展开 | 选择 | Wrap | 行号


感谢Markus。它工作得很好。
Thanks Markus. It worked perfectly.


这篇关于新的Date()问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆