I am using a simple java script to create a folding box for a web page. When the link is clicked a box should open underneath it with some text. It works fine on chrome and firefox as well as my own version of IE8.06. But when tested on earlier versions, the link disappears completely once it is clicked upon. Here is the java script:
<script type="text/javascript">
function tw_toggle(div_id) {
style = document.getElementById(div_id).style;
if (style.display == "none") {
style.display = "";
} else {
style.display = "none";
}
}
</script>
Here is the implementation:
<li><a name="fb104" href="#fb104" onClick="tw_toggle('fb104');" style="cursor:
pointer;">WS114: Probability Theory and Statistics</a>
<span class="foldbox_content" id="fb104" style="display: none;">
<br/>
<p>Visit the <a class="reference external" href="/courses/WS114">course homepage</a>.
</p> </span></li>
Does someone perhaps know what could be going wrong here?
Remove the anchor name attribute:
IE gets confused by the span having the same ID as the anchor.