<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /><body>
<script>
//创建Date对象的一个实例
var today = new Date();
//取出today对象中的星期值
var week = today.getDay(); //返回值0-6,0代表星期天
//输出中文的星期
switch(week)
{
case 1:
str = "星期一";
break;
case 2:
str = "星期二";
break;
case 3:
str = "星期三";
break;
case 4:
str = "星期四";
break;
case 5:
str = "星期五";
break;
case 6:
str = "星期六";
break;
default:
str = "星期天";
}
document.write("今天是:"+str);
</script>
</body>
4421

被折叠的 条评论
为什么被折叠?



