I have something like this:
<tr id='<%=currentRow %>' onclick="SetBackgroundColor(this)" style="background-color:Yellow">
When i click on a row i want to change its background color and i did like this:
function SetBackgroundColor(rowId)
{
$(rowId).css("background-color", "#000000");
}
but i don’t know why it doesn’t work. Any suggestions please?
IE has a problem with background colors for the TR element. A more safe way is to set background to the TD’s and TH’s inside the TR:
Added: you can assign a single event handler for the entire table to increase performance: