Mega Code Archive

 
Categories / JavaScript Tutorial / HTML Tags
 

Image substitute

< html> <head> <title>A Simple Page</title> <script language="JavaScript"> <!-- if (document.images) {     img1 = new Image;     img2 = new Image;     img1.src = "http://www.rntsoft.com/style/logo.png";     img2.src = "img2.gif"; } else {     img1 = "";     img2 = "";     document.imgSwap = ""; } //  --> </script> </head> <body> <a href="http://www.rntsoft.com" onMouseover="document.imgSwap.src = img2.src" onMouseout="document.imgSwap.src = img1.src"> <img src="http://www.rntsoft.com/style/logo.png" name="imgSwap" border="0" width=100 height=100> </a> </body> </html>