S
student4lifer
Hello,
I currently have a hyperlink to toggle the node, showing and hiding
the list. Could someone show me how to use a checkbox instead of the
hyperlink to do the same thing? Thanks.
I tried the following line but the node's nextSibling becomes
[<u>Fruits:</u>] instead of <div>. Then I tried node.
nextSibling.nextSibling but it didn't work. Please help!
<input type="checkbox" onclick="Toggle(this)" id="Fruits"><u>Fruits:</
u><div>
===========
<html>
<script language="JavaScript">
function Open(node)
{
node.nextSibling.style.display = '';
}
function Close(node)
{
node.nextSibling.style.display = 'none';
}
function Toggle(node)
{
if (node.nextSibling.style.display == 'none')
{
Open(node);
}
else
{
Close(node);
}
}
</script>
<a onclick="Toggle(this)" id="Fruits"><u>Fruits:</u></a><div>
<table>
<tr>
<td>Orange</td>
<td>Apple</td>
<td>Pearl</td>
</tr>
</table>
</div>
</html>
I currently have a hyperlink to toggle the node, showing and hiding
the list. Could someone show me how to use a checkbox instead of the
hyperlink to do the same thing? Thanks.
I tried the following line but the node's nextSibling becomes
[<u>Fruits:</u>] instead of <div>. Then I tried node.
nextSibling.nextSibling but it didn't work. Please help!
<input type="checkbox" onclick="Toggle(this)" id="Fruits"><u>Fruits:</
u><div>
===========
<html>
<script language="JavaScript">
function Open(node)
{
node.nextSibling.style.display = '';
}
function Close(node)
{
node.nextSibling.style.display = 'none';
}
function Toggle(node)
{
if (node.nextSibling.style.display == 'none')
{
Open(node);
}
else
{
Close(node);
}
}
</script>
<a onclick="Toggle(this)" id="Fruits"><u>Fruits:</u></a><div>
<table>
<tr>
<td>Orange</td>
<td>Apple</td>
<td>Pearl</td>
</tr>
</table>
</div>
</html>