I am dynamically generating my table with 15 rows and 5 columns. How can I change the background color of a cell when the user clicks in the table cell. For example if a user clicks in the 1st column of the 1st row the color changes, now if the user clicks in 3rd column of the 4th row I want to change the color of this cell but also don't want to revert the color of the previous cell clicked. Idea is anytime a user clicks any cell it changes the color. Leave the color changed so the user knows what cells are already clicked.
Here is the code that dynamically generates the table columns and rows;
Thanks
Here is the code that dynamically generates the table columns and rows;
Code:
<table>
//start for
for(i=0;i<15;i++}
<tr>
<td>i</td>
<td>i</td>
<td>i</td>
<td>i</td>
<td>i</td>
</tr>
//end for
</table>
Thanks