I am trying to select a table row, and highlight it with javascript. However, nothing seems to work. When I comment out the first two lines of the following code, I can highlight, but when I click another row, the previously selected rows stay highlighted instead of going back to white.
var selectedEventId = 0;
function SelectRow(tableRow){
var SelectedRow = Document.getElementById('selectedEventId');
SelectedRow.style.backgroundColor = 'white';
var frame = document.getElementById('additionalText');
frame.src="iframeContents.php?id="+tableRow.id;
selectedEventId = tableRow.id;
tableRow.style.backgroundColor = '3366ff';
var prevRow = document.getElementById('selectedEventId');
return;
}//end SelectRow
Any help would be appreciated.