Javascript examples for DOM HTML Element:Image
Image disappears after click on javascript
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){// ww w. ja v a 2 s .c om document.getElementById("my").onclick = function mychoice() { var name = 'abc'; document.getElementById("message").innerHTML = name; return('message'); }; } </script> </head> <body> <img id="my" src="http://www.java2s.com/style/download.png"> <p id="message"></p> </body> </html>