I want to toggle the visibility on and off. So the second click on the button should hide the image again. How do I do this?
This is my current code which only toggles the hidden .png on.
<div>
<script type="text/javascript">
function showImage(){
document.getElementById('loadingImage').style.visibility='visible';
}
</script>
<input id="text" type="button" value="Explosion Button" onclick="showImage();"/>
<img id="loadingImage" src="explosions.png" style="visibility:hidden"/>
Thanks!