how about something like (after adding the table into the document body):
$('td').click(function() {$(this).addClass('highlighted');});
This will cause
any TD
element to change colour when clicked; if you want to confine it to just the appended table, then add a unique
ID
attribute to the
TABLE
element and refer to that in the selector:
$('#addedTable td')....
(This requires you to include at least a basic version of JQuery to your page). You'll also need to add a class .highlighted with whatever visual styling you want for your highlighted cells.C