How to use the DOM API to add an image to the document in Javascript

1 Answer

0 votes
var img = new Image();

img.src = 'http://collectivesolver.com/images/web-design-book.jpg';
document.body.appendChild(img);
 
/*
run:
 
JavaScript Programming
 
*/

 



answered Jul 22, 2017 by avibootz
...