I have a table that expands or collapses to show troubleshooting steps. I need the table to change the status of multiple rows with one click.
So in this example I need to get the hide1/show2 link to work.
Thanks
TrainerDave
ps....this code also has the answer for my other post about having the row start out as hidden.
"Credit belongs to the man who is actually in the arena - T.Roosevelt
So in this example I need to get the hide1/show2 link to work.
Code:
<html>
<script language=JavaScript>
function hideRow(obj) {
if (document.getElementById(obj).style.display == "block")
{document.getElementById(obj).style.display = "none";}
else
{document.getElementById(obj).style.display = "block";}
}
</script>
<body>
<div align="center">
<p><a href="#" onclick="hideRow('row1')">Hide/Show row1</a>
<a href="#" onclick="hideRow('row2')">Hide/Show row2</a>
<a href="#" onclick="hideRow('row3')">Hide/Show row3</a>
<a href="#" onclick="hideRow('row4')">Hide/Show row4</a> </p>
<p><a href="#">Hide row1/Show row 2</a> <br>
</p>
</div>
<table border=1px align="center">
<tr id=row1 style="display:block">
<td>this is</td>
<td>row 1</td>
</tr>
<tr id=row2 style="display:none">
<td>this is</td>
<td>row 2</td>
</tr>
<tr id=row3 style="display:none">
<td>this is</td>
<td>row 3</td>
</tr>
<tr id=row4 style="display:none">
<td>this is</td>
<td>row 4</td>
</tr>
</table>
<p align="center">This is test text to see what happens </p>
</body>
</html>
Thanks
TrainerDave
ps....this code also has the answer for my other post about having the row start out as hidden.
"Credit belongs to the man who is actually in the arena - T.Roosevelt