I would like to keep first link as default selected with javascript, here is my code. currently it shows the active state and hover state. But I would like to keep the first link as by default selected and when user click on second link the first link will come at its normal state.:
<table width=100% height=20% border=0 cellspacing=0 cellpadding=0
style=margin:20px>
<tr>
<td>
<a onclick="selectElement(this)"
href=javascript:getBasicInfoPanel();
style=font-weight:normal
class="linkbold">Basic</a></td>
</tr>
<tr>
<td style=padding-top:5px;>
<a onclick="selectElement(this)"
href=javascript:getNetworkPanel();
style=font-weight:normal
class="linkbold">Network</a></td>
</tr>
<tr>
<td style=padding-top:5px;>
<a onclick="selectElement(this)"
href=javascript:getNetworkPanel2();
style=font-weight:normal
class="linkbold">Basic3</a>
<td>
</tr>
</table>
var selectedElement;
function selectElement(elem) {
/* Select new element */
elem.attributes["class"].value = "linkbolds";
/* Unselect currently selected */
if (selectedElement) {
selectedElement.attributes["class"].value = "linkbold";
}
selectedElement = elem;
}
perhaps this is what you need –