23 lines
746 B
HTML
23 lines
746 B
HTML
|
<html>
|
||
|
<head>
|
||
|
<title>Example 7.13</title>
|
||
|
<script>
|
||
|
function begin()
|
||
|
{
|
||
|
var now = new Date(); var before = new Date(); var later = new Date();
|
||
|
before.setFullYear(1812, 2, 3);
|
||
|
later.setFullYear(2095,6,15);
|
||
|
document.getElementById('now').innerHTML = ("Today's date: " + now);
|
||
|
document.getElementById('before').innerHTML = ("In the past it was: " + before);
|
||
|
document.getElementById('later').innerHTML = ("One day it will be: " + later);
|
||
|
}
|
||
|
</script>
|
||
|
</head>
|
||
|
<body><table align="center" width = "70%"><tr><td><br />
|
||
|
<input type ="button" onclick="begin()" value = "Does anyone know what day it is?"><br />
|
||
|
<h3><span id = "now"> </span></h3>
|
||
|
<h3><span id = "before"> </span></h3>
|
||
|
<h3><span id = "later"> </span></h3>
|
||
|
</body>
|
||
|
</html>
|