<!DOCTYPE HTML><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>switch</title><script type="text/JavaScript">function works(){var weekday=new Date();var myweek=weekday.getDay();//document.write(myweek);//測試myweek值switch(myweek){?case 0:?case 1:?document.write("學(xué)習(xí)理念知識");?break;?case 2:?case 3:?document.write("到企業(yè)實踐");?break;?case 4:?document.write("總結(jié)經(jīng)驗");?break;?case 5:?case 6:?document.write("周六、日休息和娛樂");?break;?default;}}</script></head><body><input type="button" value="今天干嗎?" onclick="works()"></body></html>
為什么這樣通過getDay()自動獲取星期幾的方法實現(xiàn)不了?
qq_平淡_7
2016-05-14 07:07:49