Javascript examples for DOM HTML Element:Image
Create an <img> element, assign src
<html> <head></head> <body> <div id="destination"> <!-- Destination Div --> </div> <script> // Creates Image var image = document.createElement("img"); // Sets Image Attributes image.src = "http://www.java2s.com/style/download.png"; image.width = "30"; image.height = "30"; // Adds Image to Body document.getElementById("destination").appendChild(image); </script> </body>/*from ww w. ja v a2s. c o m*/ </html>