Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q606 What code do you need to swap images in tables?

You are here: irt.org | FAQ | JavaScript | Table | Q606 [ previous next ]

Try something like:

<html>
<head>
<script language="JavaScript"><!--
function swapImage(name,image) {
    if (document.images)
        document.images[name].src = image;
}
//--></script>
</head>

<body>

<table><tr><td>
<a href="apage.html" onMouseOver="swapImage('myImage','on.gif')"  onMouseOut="swapImage('myImage','off.gif')"><img src="off.gif" name="myImage" border="0" width="16" height="16"></a>
</td><td>
<a href="bpage.html" onMouseOver="swapImage('myotherImage','on.gif')"  onMouseOut="swapImage('myotherImage','off.gif')"><img src="off.gif" name="myotherImage" border="0" width="16" height="16"></a>
</td></tr></table>

</body>
</html>

Feedback on 'Q606 What code do you need to swap images in tables?'

©2018 Martin Webb