Assignment

Write a page with three images on it, each of them a navigational icon leading to another website. Each time the user mouses over a navigational icon, it should do an image swap, and a new window should open with an appropriate URL. For example, the three images could be of an apple, a monkey, and a sun. (See http://www.bookofjavascript.com/Chapter06.) When the user mouses over the sun icon, the image could swap to a happy sun, and a window with the Sun Microsystems home page could open up. Create this effect using a function that takes three parameters: the image to swap, the new image to put in its place, and the URL to open in the new window. For example, if the user mouses over the sun icon, the image should look like this:

<img ...

Get The Book of JavaScript, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.