I have a link on a page:
<img id="po_Menu" src="images/menu_plus.jpg"> <a href="po()">show/hide</a>
that causes a <div id="po" style="display:none;">some html</div>
to show or hide.
function po(){
po = document.getElementById('po').style.display;
if (po == "none"){
document.getElementById('po').style.display = 'block';
document.getElementById('po_Menu').src = "images/menu_dash.jpg";
}
else
{
document.getElementById('po').style.display = 'none';
document.getElementById('po_Menu').src = "images/menu_plus.jpg";
}
}
The first time the hide/show link is clicked, the <div>
is displayed. Any time after that, the link does nothing and I don’t see why. I did try conversely setting the <div style="display:block;">
and clicking the link caused the <div>
to hide. Subsequently, the <div>
would not show. I am not seeing why this does not work. I have the exact same thing elsewhere on the page and that <div>
toggles.