Please send questions to
st10@humboldt.edu .
<html>
<!--
js_if1.html
Playing with a JavaScript if statement
adapted from example in:
http://www.w3schools.com/js/js_if_else.asp
a JavaScript tutorial from w3schools.com
adapted by: Sharon Tuttle
last modified: 8-27-06
-->
<head>
<title> js_if1.html: Playing with a JavaScript if statement </title>
</head>
<body>
<h3> js_if1.html </h3>
<h3> ADAPTED from example in: <br>
http://www.w3schools.com/js/js_if_else.asp, <br>
a JavaScript tutorial from w3schools.com <h3>
<h4> (adapted by Sharon Tuttle, last modified 8-27-06) </h4>
<script type="text/javascript">
<!--
// Write a "Good morning" greeting if the time is < 10
var dt = new Date()
var time = dt.getHours()
if (time > 16)
{
document.write("<strong> Good evening! </strong>")
}
else if (time > 12)
{
document.write("<strong> Good afternoon! </strong>")
}
else
{
document.write("<strong> Howdy! </strong>")
}
//-->
</script>
<noscript>
<hr>
<h3> Your browser does not support JavaScript, or has it disabled;
<br>
please note that, as a result, this page will not work. </h3>
<hr>
</noscript>
</body>
</html>