qq_Desperado_19
2016-07-14 16:03
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>获得星期</title>
<script type="text/javascript">
var mydate=new Date();
var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
var mynum=mydate.getday();
document.write("今天是:" +weedday[mynum] );
</script>
</head>
<body>
</body>
</html>
getDay方法采用驼峰法,从第二个单词开始(包括第二个单词)首字母要大写;
weekday[mynum],你把k写成了d;
myDate.getDay(); 大写
JavaScript进阶篇
468060 学习 · 21891 问题
相似问题