onmouseover and onmouseout does not work

K

Kurda Yon

Hi,

I try to create a table of images (images of the same size are put in
a table with fixed number of rows and columns). Moreover, I want image
changes if mouse is no the image. This code works fine:

<table border='0' cellpadding='0' cellspacing='10'><tr>
<td>
<div target="_blank" onmouseover="document.sub_but.src='img_tmp/
706.jpg'" onmouseout="document.sub_but.src='img_tmp/701.jpg'">
<IMG SRC="img_tmp/701.jpg" width="240" height="90" border="0"
NAME="sub_but">
</div>
</td>
<td>
</td>
</tr></table>

However, if I add an image to the second <td></td>-element, the images
(both) does not want to change if the mous is over. So the following
code does not work:

<table border='0' cellpadding='0' cellspacing='10'><tr>
<td>
<div target="_blank" onmouseover="document.sub_but.src='img_tmp/
706.jpg'" onmouseout="document.sub_but.src='img_tmp/701.jpg'">
<IMG SRC="img_tmp/701.jpg" width="240" height="90" border="0"
NAME="sub_but">
</div>
</td>
<td>
<div target="_blank" onmouseover="document.sub_but.src='img_tmp/
706.jpg'" onmouseout="document.sub_but.src='img_tmp/701.jpg'">
<IMG SRC="img_tmp/701.jpg" width="240" height="90" border="0"
NAME="sub_but">
</div>
</td>
</tr></table>

What is the reason of this behavior and how I can reach my goal?

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top