语法:newDate().getDay();
功能:获取星期
返回值:number(0-6)
var week = new Date().getDay(); var str = ""; //多条件的判断 switch 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; default: str = '六'; } document.write("今天是星期"+str);