Here is the script:
I am using an onClick to activate the function (shown below). This displays the text that is otherwise hidden. I would like to have it also simultaneously close any previous text that may already be showing while displaying new text. Any ideas?
Code:
<script language="javascript">
<!--
function showhide(item)
{
if (item.style.display=='none')
{
item.style.display='';
}
else
{
item.style.display='none'
}
}
-->
</script>
Code:
<span id="q1" style="cursor:hand;" onClick="showhide(a1)">Question 1 </span>
<span id="a1" style="display:'none'">Answer number 1 completed.</span>