Creating an Image Element
Firstly, you need to create an image element. This can be done using the document.createElement() method.
Setting the Image Source
After creating the image element, you need to set the source of the image using the src attribute.
Appending the Image to the Document
Finally, you append the image element to the document using the appendChild() method.
var img = document.createElement('img');
img.src = 'path_to_your_image.jpg';