Coding & Programming > JavaScript Forum

Onclick image dissapear.

(1/1)

electra:
Hi, I need to make a picture dissapear onlick using java script. I will be honest I am lost because I'm new to java and I can't find a tutorial for this! I have been experimenting with other onclick uses (alerts etc) but this one is bugging me!


Thanks,

Vinil:
se you have mentioned two things -java and javascript -For you kind information both are different languages .if you are new to java ,it doesnt matter to javascript
In case you indeed want help in javascript ,this post is relevant to category and i may help you
see in javascript,onclick() event ,disable the visible property on image  and call the function when user click .

Shikha Singh:
add this code in your body tag but change "img.png" to your image source

<img src="img.png" onclick="this.style.display='none';" style="position:absolute;opacity:0.5;left:50%;top:50%;width:100px;height:100px;margin-left:25px;margin-top:25px;z-index:100;"/>

Lishmalinyjames:
What is supposed to happen is to click on an image with an HTML tag of logo to make it disappear, then click a button that says "Get Logo" to bring it back.

Navigation

[0] Message Index

Go to full version