Hello!
Not sure if I should post this in one of the other sub-forums, I apologize in advance if so.
I am having an icon which function is to show/hide a div. It works fine, but I do want the icon to change to a different icon when clicked, so it is one icon to show the div, and a different icon to hide the div.
Here is the code:
Code:
function hide_menu(id){
document.getElementById(id).style.display = "none";
}
function show_menu(id){
document.getElementById(id).style.display = "block";
}
and the html:
Code:
<div id="infotekst">
<input type="image" src="info_kvit3.png" width="35" height="35"
onclick="if (document.getElementById('idOfDiv').style.display=='none')
show_menu('idOfDiv'); else hide_menu('idOfDiv');"></button>
</div>
Thanks,
Saphigon