JavaScript:
function showOrHide()
{
var div = document.getElementByClass("showorhide");
if (div.myDivClass.display == "block")
{
div.myDivClass.display = "none";
}
else
{
div.myDivClass.display = "block";
}
}
css:
.showorhide {
display: none;
padding: 12px 0px 12px 0px;
}
html:
<div align="left" style="padding-bottom:3px;"><font size="5">Chat Issues:</font></div>
<a href="javascript:showOrHide();"><font size="3">Are there any age requirements?</font></a>
<ul style="margin:0px 0px 0px 0px;">
<div class="showorhide">
<li>Yes. You must be 13 years of age or older to use our chatrooms. Anyone under the age of 13 will be directed to a chatroom more suitable for their age.</li>
</div>
</ul>
<a href="javascript:showOrHide();"><font size="3">Can i advertise in your chatroom? </font></a>
<ul style="margin:0px 0px 0px 0px;">
<div class="showorhide">
<li>Absolutely not! Advertising is strictly prohibited and anyone caught advertising will be banned without warning.</li>
</div>
</ul>
It used to have a div id which worked great but i need to use same id and multiple show/hides without changing the id and making ton of code, so i tried chan ging it to a class for this but i cant seem to get it to work. It hides the content but wont bring it up when clicked, any suggestions guys?