- Code: Select all
<style language="text/css">
.box{
display : none;
}
</style>
function doExpandCollapse(id,img){
var b = document.getElementById(id);
if (b.style.display=='none'){
b.style.display='inline';
}
else{
b.style.display='none';
}
return false;
}
OLD POST:
Heres my problem, the code I have been working on bellow is meant to expand and collapse text\forms\whatever....on load I want it to be collapsed however it is always expanded no matter what I seem to do.
So how can I get it to load collapsed?
Thanks in advanced!
~p4plus2~
- Code: Select all
<html>
<head>
<script>
function doExpandCollapse(id,img){
var b = document.getElementById(id);
if (b.style.display=='none'){
b.style.display='';
}
else{
b.style.display='none';
}
return false;
}
</script>
</head>
<body>
<form>
<div style="border:0px;">
<a href="#" onclick="return doExpandCollapse('box','btn1')">expand/collapse</a>
<div id="box">
blah<br>blah<br>blah<br>blah<br>blah<br>blah<br>
</div>
</div>
</form>
</body>
</html>


