问答详情
源自:7-4 返回星期方法

请问哪里错了

<!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>


提问者:qq_Desperado_19 2016-07-14 16:03

个回答

  • txqq
    2016-07-14 16:27:54
    已采纳

    getDay方法采用驼峰法,从第二个单词开始(包括第二个单词)首字母要大写;

    weekday[mynum],你把k写成了d;

  • qq_流云逝水_03662735
    2016-07-14 16:16:06

    myDate.getDay(); 大写