var taday = new Date(); var week = taday.getDay(); switch(week){ case 0: str = "星期日"; break; case 1: str = "星期一"; break; case 2: str = "星期二"; break; case 3: str = "星期三" break; case 4: str = "星期四"; break; case 5: str = "星期五"; break; case 6: str = "星期六"; break; } document.write(str)
js输出当前星期几--switch case
最新推荐文章于 2024-06-22 17:05:11 发布