?? 13.10 分時段問候用戶.htm
字號:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>標題頁</title>
<script language="javaScript">
now = new Date();
hour = now.getHours(); //獲取當前時間的小時數(shù)
//將時間分段,并對應不同的提示用語
if(hour < 6){document.write("歡迎光臨,凌晨好!")}
else if (hour < 9){document.write("歡迎光臨,早上好!")}
else if (hour < 12){document.write("歡迎光臨,上午好!")}
else if (hour < 14){document.write("歡迎光臨,中午好!")}
else if (hour < 17){document.write("歡迎光臨,下午好!")}
else if (hour < 19){document.write("歡迎光臨,傍晚好!")}
else if (hour < 22){document.write("歡迎光臨,晚上好!")}
else {document.write("歡迎光臨,午夜好!")}
</script>
</head>
<body>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -