Click here to Skip to main content
15,903,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

i have a image tag in my html page.
i want to insert a image dynamically , so that purpose
at design time i won't see the image tag it should be in unvisible.
pls any body help to me how can i hidden the image tag at before running the application(Html page) and after click on the button image tag should appear ?

Thanks in advance,
Regarding ,
Posted

1 solution

First set Image Tag with a blank image like 1 x 1 pixel white image.
Then use Javscript

You'll need to use javascript for this:

HTML
<img src="white.jpg" id="RunTimemage" />


HTML
<script type="text/javascript">
  document.getElementById("RunTimeImage").src = "image3.jpg";
</script>


Also you can toggle its visibility too if you want:
Declare it invisible.

HTML
<img src="" style="visibility:hidden"></img>


Make it visible:

HTML
document.getElementById(RunTimeImage).style.visibility = 'hidden';
 
Share this answer
 
Comments
Unareshraju 6-Sep-12 0:45am    
hi Kuthuparakkal,
Thank you so much ...
super solution!!!!!!!.
Kuthuparakkal 6-Sep-12 22:15pm    
you're most welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900