根据时间显示不同问候
演示效果看这-》:
代码提示:将下面的代码复制到<body></body>中
<!-- 可将下面的文字根据需要进行更改--> <script language="LiveScript"> now = new Date(),hour = now.getHours() if(hour < 6){document.write("太晚了,该休息了!!!")} else if (hour < 8){document.write("早上好!全新的一天开始了!")} else if (hour < 12){document.write("上午好!工作辛苦了!")} else if (hour < 14){document.write("中午好!还在上网吗?")} else if (hour < 18){document.write("下午好!祝你工作顺利!")} else if (hour < 22){document.write("晚上好!祝你玩的愉快!")} else if (hour < 24){document.write("夜深了! 要注意身体呀! 祝你做个好梦!")} </script>
本站浏览量: