SWE 642 JavaScript example: onClick

Text version Next example Back to index

In JavaScript 1.1 (Netscape 3 and 4 but not IE), document.images contains an array of Image objects that correspond to each IMG in the document. Changing this array changes the associated image.

Numbers work, but are difficult to use. Luckily, we can give IMG elements NAME attributes.