I have an anchor that's when click shows the content depending on what the id it matches. but the script doesn't work.
HTML:
<a href="javascript:ReverseDisplay('asd')">
Click to show/hide</a>
<div id="asd" style="display:none;">
<p>Content goes here.</p>
</div>
SCRIPT:
function HideContent(d) {
document.getElementById(d).style.display = "none";
}
function ShowContent(d) {
document.getElementById(d).style.display = "block";
}
function ReverseDisplay(d) {
if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
else { document.getElementById(d).style.display = "none"; }
}
FIDDLE HERE