返回星期方法
任务
补充右边编辑器第9行,使用getDay()获得当前星期,并输出。
<!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 mynum = mydate.getDay(); var weekday=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]; document.write("今天是:" + weekday[mynum]); </script> </head> <body> </body> </html>