Q:

javascrpit add image element

function add_img() { 
	var img = document.createElement('img'); 
    img.src = 'https://media.geeksforgeeks.org/wp-content/uploads/20190529122828/bs21.png'; 
	document.getElementById('body').appendChild(img);
}
1
var img = document.createElement('img');
2

New to Communities?

Join the community