Can any one help me sort the below code. I want to show a question on my page and if you click on the question I want the answer to appear. The below code works but loops.
Within my css file I have:
.posthidden {
display:none
}
.postshown {
display:inline
}
within my main page I have:
<DIV>
<a href="#" onclick="docume nt.getElementBy Id('the_div2'). style.display=( document.getEle mentById('the_d iv2').style.dis play=='block')? 'none':'block'; "><strong>
Question written in here</A> . <br>
<div id="the_div2" style="margin-left: 20px;display:no ne;">
answer written in here
<BR>
</DIV>
any one any ideas?
Within my css file I have:
.posthidden {
display:none
}
.postshown {
display:inline
}
within my main page I have:
<DIV>
<a href="#" onclick="docume nt.getElementBy Id('the_div2'). style.display=( document.getEle mentById('the_d iv2').style.dis play=='block')? 'none':'block'; "><strong>
Question written in here</A> . <br>
<div id="the_div2" style="margin-left: 20px;display:no ne;">
answer written in here
<BR>
</DIV>
any one any ideas?
Comment