how to add different images in different div using javascript code example Example: add an image to a div with javascript div. innerHTML += '<img src="'+img. src+'" />';