Highlight a table row on click
Hi, I have a table like:
-
<table id="file_list_table" class="table_to_sort" width="200" border="1">
<thead>
<tr>
<th width="100px">name</th>
<th width="100px">size</th>
<th width="100px">delete</th>
</tr>
</thead>
<tbody>
<tr>
<td>stuff</td>
<td>otherstuff</td>
<td>morestuff</td>
</tr>
</tbody>
</table>
I want the entire row to change color when it is clicked, but what I try doesn't work:
-
$("#file_list_table tbody tr").click(function(){
$(this).children("td").css('background-color',"#F4F874");
})
Any help would be great.
Thanks