<html> <head> <title>显示中文的星期几</title> </head> <body> <div id="showDay"></div> <script> var sd=document.getElementById("showDay"); //获得当前是星期几 var dt=new Date(); var gd=dt.getDay(); //alert(gd); switch(gd){ case 1: sd.innerHTML="星期一"; break; case 2: sd.innerHTML="星期二"; break; case 3: sd.innerHTML="星期三"; break; case 4: sd.innerHTML="星期四"; break; case 5: sd.innerHTML="星期五"; break; case 6: sd.innerHTML="星期六"; break; case 0: sd.innerHTML="星期天"; break; default: sd.innerHTML="什么情况!"; } </script> </body> </html>