代码示例:(标识:vbst_ifthen)
<html>

<head>
<script type="text/vbscript">
function greeting()
i=hour(time)
if i < 10 then
 document.write("Good morning!")
else
 document.write("Have a nice day!")
end if
end function
</script>
</head>

<body onload="greeting()">
</body>

</html>
运行结果: