First page Back Continue Last page Image

Screen Shot

<!DOCTYPE html>

<html>

<head>

<title>Dynamic Date Display</title>

<script src="script01.js"></script>

</head>

<body>

<h1>Today is <span id="dtField"> </span>.</h1>

</body>

</html>

window.addEventListener("load",initDate,false);

function initDate() {

var dayName = new Array("Sunday", "Monday", "Tuesday", "Wednesday", \

"Thursday", "Friday", "Saturday");

var monName = new Array("January", "February", "March", "April", "May", \

"June", "July", "August", "September", "October", "November", "December");

var now = new Date();

var dtString = dayName[now.getDay()] + ", " + monName[now.getMonth()] + " " \

+ now.getDate();

document.getElementById("dtField").innerHTML = dtString;

}