I have this table and those buttons. I want to hide the rows that are checked whith the hide button and show them again with the other button. I have problems hidding the rows, i can hide a checkbox at a time but not the entire row, neither all checked boxes through a loop. please help.
<table>
<tr>
<td><input type="checkbox" id="box1" />
</td><td>a mmmmmmmmmmmmmm</td>
</tr>
<tr>
<td><input type="checkbox" id="box2" /></td>
<td>b mmmmmmmmmmmmmm</td>
</tr>
<tr>
<td><input type="checkbox" id="box3" /></td>
<td>c mmmmmmmmmmmmmm</td>
</tr>
<tr>
<td><input type="checkbox" id="box4" /></td>
<td>d mmmmmmmmmmmmmm</td>
</tr>
<tr>
<td><input type="checkbox" id="box5" /></td>
<td>e mmmmmmmmmmmmmm</td>
</tr>
</table>
<input type="button" value="hide" onclick="hd();" />
<input type="button" value="show all" onclick="sh();" />
function hd(){
box=document.getElementById('box1');
if (box.checked==true){box.style.display='none';}}
function sh(){
box=document.getElementById('box1');
box.style.display='inline';}