Hi, I'm currently using an expand/collapse script for my website, however, it seems that it is expanded by default. Now, I know absolutely nothing about javascript, so i was wondering if any of you could help me to get it collapsed by default
The script:
<script langauge="JavaScript" type="text/javascript">
function doMenu(item) {
obj=document.getElementById(item);
col=document.getElementById("x" + item);
if (obj.style.display=="none") {
obj.style.display="block";
}
else {
obj.style.display="none";
}
}
</script>
<a href="javascript:doMenu('main');" id=xmain> Main Item</a>
<div id=main style="margin-left:0em">hi there</div>
The script:
<script langauge="JavaScript" type="text/javascript">
function doMenu(item) {
obj=document.getElementById(item);
col=document.getElementById("x" + item);
if (obj.style.display=="none") {
obj.style.display="block";
}
else {
obj.style.display="none";
}
}
</script>
<a href="javascript:doMenu('main');" id=xmain> Main Item</a>
<div id=main style="margin-left:0em">hi there</div>