Hi guys
I want to change the background colour of the td and also the colour of the link when you click on it.Cna you please help me out
Developer husain
Printable View
Hi guys
I want to change the background colour of the td and also the colour of the link when you click on it.Cna you please help me out
Developer husain
The simplest way is:
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:<td onclick="this.style.backgroundColor = 'red';">Whatever</td>
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?Code:<style type="text/css">
a:link {background-color: blue;}
a:active {background-color: red;}
a:visited {background-color: red;}
</style>