I\'m trying to change the background color of an HTML table cell when the user clicks on the cell. Any ideas on how to do this? I have access to the JS Prototype library, so
You could loop over all the children of the table and add an click event to them
with prototype the code is:
$('your_table').observe('click', function(event) { var clickedCell = event.findElement('td'); if (clickedCell) { clickedCell.setStyle({ background: '#dfd' }); } });