<!DOCTYPE html>charset="utf-8"编程狮(w3cschool.cn)JavaScript switchid="demo"var text;switch (new Date().getDay()) {case 4:case 5:text = "周末马上就到了";break;case 0:case 6:text = "今天是周末";break;default:text = "期待周末";}document.getElementById("demo").innerHTML = text;