On my site I am working on a jQuery script that when you click anywhere in a td (not just on the link) it will take you to the link's destination, but whenever I click it always say it is undefined which always returns a false page.
jQuery:
HTML:
Here is a link to a live site if you need it
The destination is the same for all of them for the test. It is supposed to link to this.
Thanks in advance.
jQuery:
Code:
$(document).ready(function() {
$("table#colorNavTable tr td").click(mouseClick);
})
function mouseClick() {
var url = $(this).next().attr("src");
window.location = url;
return false;
}
HTML:
HTML:
<table width="100" id="colorNavTable" cellpadding="2" cellspacing="2">
<tr>
<td><a href="page2.html">Child 1</a></td>
</tr><tr>
<td><a href="page2.html">Child 2</a></td>
</tr><tr>
<td><a href="page2.html">Child 3</a></td>
</tr><tr>
<td><a href="page2.html">Child 4</a></td>
</tr>
</table>
Here is a link to a live site if you need it
The destination is the same for all of them for the test. It is supposed to link to this.
Thanks in advance.