Javascript examples for DOM HTML Element:Image
Create <img> element and set image src
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//from w ww .j a v a 2 s . c o m var myanim = new Image(); myanim.src = 'http://www.java2s.com/style/download.png'; myanim.onload = function() { document.getElementById('anim').src = myanim.src; } }); </script> </head> <body> <img id="anim" src="http://www.java2s.com/style/download.png"> </body> </html>