I have multiple tables wher each row is defined by an ID and a class. The words in each row are actually href links
. I have one button with id testbuttonba
. If testbuttonba
is clicked, I want the following to occur:
1) href
for ID table1
to be disable.
2) href
for ID table2
and table3
to still be enabled.
My code below does not work (all links are still enabled after clicking):
HTML
<body>
<button class="btnba" id="testbtnba" onclick="function2()">BA</button>
/* 1st Table */
<table>
<tr>
<th><font size="1">Capability Group</font></th>
</tr>
<tbody id="table1">
<tr>
<td><a href="showdoc.html"><font size="1"><strong>A. Organisational Content</strong></font></a></td>
</tr>
</table>
/* 2nd Table */
<table>
<tr>
<th><font size="1">Capability Group</font></th>
</tr>
<tbody id="table2">
<tr>
<td><a href="showpdf.html"><font size="1"><strong>B. Basic Requirements</strong></font></a></td>
</tr>
</table>
/* 3rd Table */
<table>
<tr>
<th><font size="1">Capability Group</font></th>
</tr>
<tbody id="table3">
<tr>
<td><a href="showexcel.html"><font size="1"><strong>C. Rules and Regulations</strong></font></a></td>
</tr>
</table>
JavaScript
<script>
/*diasble the first link - not working*/
function function2() {
document.getElementById("table1").href = "#";
}
return false;
</script>