how to hilite a row?
Moderator: General Moderators
how to hilite a row?
i have a table and in the beginnning column I have radio buttons each for a row.Now my problem is,If somebody clicks on a particular radio button then the whole row should get hilited.Is it possible?? Can you guide me, please.
I'm not certain, but I believe you can also put an onclick event handler on the row itself. In that handler, use 'this.style.backgroundColor' to change the colour. You'll need to use fancier javascript to change it back to unhighlighted as well.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Do something like this you could...
although change the row color back it will not when selecting a different radio button (on a different row) you are.
Code: Select all
<table>
<tr onClick="(this.style.backgroundColor == '#ff0000' ? this.style.backgroundColor = '#ffffff' : this.style.backgroundColor = '#ff0000')">
<td>
<input type="radio" name="blah" value="blah">
</td>
<td>
Blah
</td>
</tr>
</table>