| Author: Kundan Kumar Sinha 21 Jul 2008 | Member Level: Gold | Rating: Points: 6 |
Hi, Use the following code.
<html> <head> <script type="text/javascript"> function getValue(i) { if(i=='1'){ var x=document.getElementById("img1") x.innerHTML = 'Image1'; } else { var x=document.getElementById("img2") x.innerHTML = 'Image2'; } } </script> </head> <body> <h1>Move the mouse over image to see the caption.</h1>
<table border="1"> <tr> <td width="50%"><img src="Image1.jpg" width="100" height="100" onmouseover="getValue(1)" /></td> <td width="50%"><img src="Image2.jpg" width="100" height="100" onmouseover="getValue(2)" /></td> </tr> <tr> <td> <div id="img1"></div></td> <td> <div id="img2"></div></td> </tr> </table> </body> </html>
|