On my website, I have a glossary of terms in Japanese. Clicking on each term causes a dropdown which shows the English translation. I have a problem, however, once I click on the first term in the list, all of the following links end up changing color (as though the user has already clicked on them). How do I fix this problem.
My header script is
<script language=”javascript”>
<!–
var state = ‘none’;
function showhide(layer_ref) {
if (state == ‘block’) {
state = ‘none’;
}
else {
state = ‘block’;
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( “document.all.” + layer_ref + “.style.display = state”);
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
}
//–>
</script>
The body script is
<p><a href=”#” onclick=”showhide(‘div1’);”>show/hide me</a></p>
<div id=”div1″ style=”display: none;”>This is the content</div>
<p><a href=”#” onclick=”showhide(‘div2’);”>show/hide me</a></p>
<div id=”div2″ style=”display: none;”>This is the content</div>
Etc.
I look forward to any and all feedback.
Knuckle