Step-1 :
Use below javascript code with you div ID. like "myDivBox".
<script language="javascript"
type="text/javascript">
function
toggleDiv()
{
if (document.getElementById("myDivBox").style.display ==
"block")
{
document.getElementById("myDivBox").style.display =
"none";
}
else
{
document.getElementById("myDivBox").style.display =
"block";
}
}
</script>
Step-2 :
Add onclick() event on you button or whatever you use to show/hide div.
and make sure that..id of your div is same with javascript code use above.
<input type="button" id="button1" name="button1" OnClick="toggleDiv()"/>
<div>
<div id="myDivBox" style="display:none; width
:300px">
Content or your coding to hide in between this div.
</div>
</div>
No comments:
Post a Comment