You are here: irt.org | FAQ | JavaScript | Image | Q952 [ previous next ]
Try the following simple code:
<script language="JavaScript"><!-- if (document.images) { imageoff = new Image(); imageoff.src = 'imageoff.jpg'; imageon = new Image(); imageon.src = 'imageon.jpg'; } function change(image,ext) { if (document.images) document.images[image].src = eval(image + ext + ".src"); } //--></script> <a href="nextpage.htm" onMouseOver="change('image','on')" onMouseOut="change('image','off')"><img name="image" src="imageoff.jpg" width="20" height="20" border="0" alt="Image"></a>