How to create a hidden in JavaScript?

I’m not sure I understand your question. But there are two approaches to making the image invisible…

Pure HTML

<img src="a.gif" style="display: none;" />

Or…

HTML + Javascript

<script type="text/javascript">
document.getElementById("myImage").style.display = "none";
</script>

<img id="myImage" src="a.gif" />

Leave a Comment