On this page are four examples of how JavaScript can be added to the HTML coding of a Web page to produce effects not possible with HTML alone. The first example is the roll-over buttons in the Navigation Bar at the top of this page. When your mouse moves over a button the text changes color and a click takes you to the link. Three other examples are listed below.
JavaScript can be used to print out the day, month, date, and
year in the browser window by reading from the computer's clock; for example,
If you return to this page tomorrow, or any later day, the date will be correct
for that day so long as your browser's clock is accurate.
JavaScript can do calculations using dates; for instance, the coding for this
Web page includes a JavaScript function that calculates the days remaining before December 31st and then
displays the following message in your browser window:
Tomorrow the function will report one day less remaining, and on December 30th on it will report that the
number of days remaining is 1. Count down the days on a calendar and see whether the JavaScript function is
correct.
JavaScript can be used to display two or more images
in rotation. Watch the two alternating images, one of Don and the other of Ruth as they were playing golf
on the Chica golf course in Valencia in the summer of 2001.