Topic: highlight a row of a mother table that has an image in a nested table
Hello, I'm new at jquery and im interested to solve the following problem,
to explain myself better, here is an example html code:
<body>
<table width="200" border="1">
<tr>
<td> </td>
<td> </td>
<td> </td>
<td>
<table>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr><td><a href="#" class="textred">hi</a></td></tr>
<tr><td> </td></tr>
</table>
</td>
<td><a href="#" class="textred">hello</a></td>
</tr>
<tr>
<td> </td>
<td><a href="#">hello</a></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><table>
<tr><td> </td></tr>
<tr><td><a href="#" class="textred">hi</a></td></tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
</table></td>
<td><a href="#" class="textred">hello</a></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td><td> </td><td> </td>
<td><a href="#">hello</a></td>
<td><table>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr><td> </td></tr>
<tr><td><a href="#" class="textred">hi</a></td></tr>
</table></td>
</tr>
<tr>
<td> </td><td> </td>
<td><a href="#" class="textred">hello</a></td>
<td> </td>
<td> </td>
</tr>
</table>
-------------------------
the css is simple:
.yellow{background-color:#FF0}
.textred{color:#F00}
-------------------------
the jquery (as far as i got!):
$(function(){
$('a.textred').click(function(){;
$(this).parent().parent().toggleClass('yellow');
});
});
--------------------------
THE PROBLEM:
Whether i click on "hi" (the problem is the "hi") or "hello", i would like to highlight the whole row of the 'mother' table, regardless of its position in the embedded table
Thanks very much,
Amor

