I have the following code:
function createImage(source) { var pastedImage = new Image(); pastedImage.onload = function() { } pastedImage.src = source; }
The createImage function contains a source parameter that contains the image source. After that, I created a pastedImage object of the Image class and after warning that I was getting an html image element object, for example [object HTMLImageElement]
.
My question is how can I display an image on my html page using this object. I want to display it after the onload function.
Thanks in advance.
source share