I have a simple div / unhide div section using simple JavaScript. I need to have an arrow image that will switch to the visibility of the content when clicked, and I want the small arrow to switch between the right / bottom positions when the content is hidden and not hidden.
HTML content:
<a href="javascript:showOrHide();"><img src="Image_Files/Copyright.png" alt="BioProtege Inc" border="0" /></a> <img src="Image_Files/Copyright_Arrow_Hidden.png" alt="Arrow" border="0" /> <div id="showorhide"> Copyright 2012+ BioProtege-Inc.Net | LG Fresh Designz <br /> Contact Us @ Lane.Gross@Edu.Sait.Ab.Ca </div>
JavaScript content:
function showOrHide() { var div = document.getElementById("showorhide"); if (div.style.display == "block") { div.style.display = "none"; } else { div.style.display = "block"; } }
source share