x
 
<html>
<body>
<p>单击这个按钮可根据今天的日期显示一条消息。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
  var text;
  switch (new Date().getDay()) {
    case 6:
      text = "Today is Saturday";
      break;
    case 0:
      text = "Today is Sunday";
      break;
    default:
      text = "Looking forward to the Weekend";
  }
  document.getElementById("demo").innerHTML = text;
}
</script>
</body>
</html>