Learning HTML..is fun!

Miscellaneous Forums/General Discussion/Learning HTML..is fun!

Here's something interesting. I was trying to find a really easy way to do mouseover stuff in html. This method I came up with directly accesses the document image cache with a one line javascript function. The trick is to Name your img src specifically in numerical order as they're created. It's very easy. Your first image name would be Name="images0", next "images1", images2", etc etc. What do you think?
<html>
<head>
<title>HTML Mouse RollOver</title>

<link rel="stylesheet" type="text/css" href="style.css" />

<script type="text/javascript">
function show(num,imageSrc)
{
     if (document.images) document.images[num].src = imageSrc;
}
</script>

<head>

<table align="center">
<tr>
<td><img src="blue.gif" name="images0" onMouseOver="show('0','red.gif')" onMouseOut="show('0','blue.gif')"></td>
</tr><tr>
<td><img src="blue.gif" name="images1" onMouseOver="show('1','red.gif')" onMouseOut="show('1','blue.gif')"></td>
</tr>
</table>

</body>
</html>