javascript set image src dynamically code example
Example 1: 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);
}
Example 2: set img src using javascript
document.getElementById("imageid").src="../template/save.png";