SWE 432 JavaScript example: onClick

Text version Next example Back to index

JavaScript 1.1 (Netscape 3 and 4 but not IE), document.images introduced 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.