10.html

来自「JAVA程序设计课程中各章节的程序实例。」· HTML 代码 · 共 31 行

HTML
31
字号
<html>
<body>

<script type="text/javascript">
var d = new Date()
var time = d.getHours()

if (time < 10) 
{
document.write("<b>Good morning</b>")
}
else
{
document.write("<b>Good day</b>")
}
</script>

<p>
This example demonstrates the If...Else statement.
</p>

<p>
If the time on your browser is less than 10,
you will get a "Good morning" greeting.
Otherwise you will get a "Good day" greeting.
</p>

</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?