I'm experiencing an issue with a div element that I created. My goal is to have it expand when a link is clicked and collapse when the same link is clicked again. At the moment, the div expands correctly but does not collapse as expected. Any assistance would be greatly appreciated.
<script>
function setDisplay()
{
document.getElementById('divCollapse').style.display="none";
}
function expandSelected()
{
if(document.getElementById('divCollapse').style.display="none")
{document.getElementById('divCollapse').style.display="block";}
else if(document.getElementById('divCollapse').style.display="block")
{document.getElementById('divCollapse').style.display="none";}
}
</script>