title: Javascript Table Select
body: <p>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.</p>
  
  <pre><code>    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
  </code></pre>
  
  <p>Any help would be appreciated.</p>