I used something like this 2-3 years ago on one of my school assigmnets. Maybe it will help you...
Script in the
head of html
<script type="text/javascript"><!--function to hide/show submenu options-->
(document.getElementById ? DOMCapable = true : DOMCapable = false);
function show(menuName)
{
if (DOMCapable)
{
if(document.getElementById("menu1choices").style.visibility=="hidden")
{
document.getElementById("menu1choices").style.display="block";
document.getElementById("menu1choices").style.visibility="visible";
}
else
{
document.getElementById("menu1choices").style.display="none";
document.getElementById("menu1choices").style.visibility="hidden";
}
}
}
function hide(menuName)<!--Function to hide submenu if any other option from main menu selected-->
{
if (DOMCapable)
{
document.getElementById("menu1choices").style.display="none";
document.getElementById("menu1choices").style.visibility="hidden";
}
}
</script>
Inside
body of html
<div id="menu1" onClick="show('menu1choices');">
<p class="black_link" style="cursor: pointer;">Quiz</p></div>
<div id="menu1choices" style="display: block; visibility: visible;">
<table border="0">
<tbody><tr>
<td><a href="quiz1.html"
target="main" class="black_smaller">Quiz 1</a></td>
</tr>
<tr>
<td><a href="test.html"
target="main" class="black_smaller">Quiz2</a></td>
</tr>
</tbody>
</table>
</div>
<script type="text/javascript">
if (DOMCapable)
{
show("menu1");
}
</script>
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.