The simplest way is:
Code:
<td onclick="this.style.backgroundColor = 'red';">Whatever</td>
You can do a link the same way, but a link will usually take you away from a page. So you can use css style instead:
Code:
<style type="text/css">
a:link {background-color: blue;}
a:active {background-color: red;}
a:visited {background-color: red;}
</style>
Often when someone asks this question they want all tds in the table except the one clicked to be one background color and the clicked one to change to another background color. Is that what you want?
Bookmarks