wrote:
> And tried to change visibility of a DIV, but this doesn't work.
> How can I change visibility of set of TRs?
Hi,
It is simple if you know which rows you want to hide/show.
Here is the example:
<html>
<head>
<script>
function changeVisibility(show)
{
var rows = document.getElementById("tbl").rows;
for(var i=0;i<rows.length;i++)
if (i==1 || i==2 || i==3)
rows[i].style.display = show ? "" : "none";
}
</script>
</head>
<body>
<table id="tbl">
<tr><td>0</td></tr>
<tr><td>1</td></tr>
<tr><td>2</td></tr>
<tr><td>3</td></tr>
<tr><td>4</td></tr>
</table>
<input type="button" onclick="changeVisibility(true)" value="Show
Rows">
<input type="button" onclick="changeVisibility(false)" value="Hide
Rows">
</body>
</html>