W3School TIY
编辑您的代码:
<html> <body> <script type="text/javascript"> var d = new Date() var time = d.getHours() if (time < 10) { document.write("<b>早安</b>") } </script> <p>本例演示 If 语句。</p> <p>如果浏览器时间小于 10,那么会向您问“早安”。</p> </body> </html>
查看结果: