I am still learning sorry.
I nearly understand this!
I want several separate toggle buttons inside a table to toggle their own multiple rows
the script below is neat for one set of multiple rows,
how do i add more toggles- controlling their own separate rows.
would each toggle have a unique id that had to equal the tag name of the rows
is this just a line in the function -what would it be ?
sorry to be so new to this
thanks for any help
<html>
<head>
<script>
function toggle(thisname) {
tr=document.getElementsByTagName(‘tr’)
for (i=0;i<tr.length;i++){
if (tr[i].getAttribute(thisname)){
if ( tr[i].style.display==’none’ ){
tr[i].style.display = ”;
}
else {
tr[i].style.display = ‘none’;
}
}
}
}
</script>
<style type=”text/css”>
<!–
#apDiv1 {
position:absolute;
left:251px;
top:51px;
width:342px;
height:287px;
z-index:1;
}
–>
</style>
</head>
<body>
<div id=”apDiv1″>
<table width=”226″ border=”1″ cellspacing=”0″ cellpadding=”5″>
<tr>
<td width=”110″>Run main</td>
<td width=”18″> </td>
<td width=”60″><span onClick=”toggle(‘nameit’);”>toggle</span></td>
</tr>
<tr nameit=run>
<td>Run version2</td>
<td> </td>
<td> </td>
</tr>
<tr nameit=run>
<td>Run version 3</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Walk main</td>
<td> </td>
<td>toggle2</td>
</tr>
<tr>
<td>Walk version2</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Walk version3</td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</script>
</body>
</html>