highlight unhighlight link background?
Hi, I'm trying to create link that when a user clicks it, it will highlight the link with a bgcolor of blue, while when the user clicks on another link, the previous link will unhighlight and highlight the new link which was clicked.
What I've been trying had got me into this:
function highlight( )
var oObj = event.srcElement;
oObj.style.color = "#FFFFFF";
oObj.style.background = "#000066";
for (i = 0; i < 13; i++)
if(i.style.color == "#FFFFFF")
For this snippets, its working on the highlighting part, but I've no idea how to get the unhighlighting work. :(
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="body">
<td><div onClick="highlight( );">Link 1</div></td>
<td><div onClick="highlight( );">Link 2</div></td>
I've done lots of search on google but no luck. Hope someone could help me here. Thanks in advanced.