输入对了为什么不显示??和答案一样的啊
为什么不显示???
为什么不显示???
2018-08-09
参照代码
<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("今天是:" + mydate.getDay()+"<br>" );
document.write("今天是:" + weekday[mydate.getDay()]);
</script>
</head>
<body>
</body>
</html>
虽然不知道你说的啥,但是我还是默默地粘上我的代码,希望对你有帮助。
<!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 day=mydate.getDay();
document.write(day);
document.write("今天是:" + weekday[day]);
</script>
</head>
<body>
</body>
</html>
举报