document.write("今天是:" +weekday[mydete.getDay()]);问题再那??
你的mydate写成了mydete 下次拼写单词要注意哈 满意请采纳
mydate not mydete
var mydate=new Date();
var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];//定义数组对象,给每个数组项赋值
var mynum=mydate.getDay();
document.write(mydate.getDay()+"<br>");
document.write("今天是:"+ weekday[mynum]);
为什么我的输出结果为:
2
今天是:星期二
你的weekday定义了没
aiyouwo