I have a table in the following format:
<table id="searchResultTable">
<tr>
<th>List</th>
</tr>
<tr onMouseOver="activeTr(this)"
onMouseOut="inactiveTr(this)" onClick="showDetails(TODO)">
<td><a href="javascript: void(0)">AAA</a></td>
</tr>
<tr onMouseOver="activeTr(this)"
onMouseOut="inactiveTr(this)" onClick="showDetails(TODO)">
<td><a href="javascript: void(0)">BBB</a></td>
</tr>
</table
The following CSS:
table#searchResultTable td {
text-align: left;
border-bottom: 1px solid #ECD7C2;
}
.bold {
font-weight: bold;
}
And the following JS functions:
function activeTr( row ) {
row.bgColor='#ECD7C2';
document.body.style.cursor = 'pointer';
}
function inactiveTr( row ) {
row.bgColor='transparent';
document.body.style.cursor = 'default';
}
Everything works fine so far. But now I'm trying to replace the class for selected row to .bold and have to remove the same class from all other unselected rows - that's what showDetails(TODO)
should do. I made several attempts (including based on the content as described here), but couldn't get it to work.
Please point me in the right direction (JQuery would be great ;). Many thanks!