1//change image src
2document.getElementById('myImageID').src="images/my_other_image.png";
1// Pure JavaScript to Create img tag and add attributes manually ,
2var image = document.createElement("img");
3var imageParent = document.getElementById("body");
4image.id = "id";
5image.className = "class";
6image.src = searchPic.src; // image.src = "IMAGE URL/PATH"
7imageParent.appendChild(image);
8
9// Set src in pic1
10document["#pic1"].src = searchPic.src;
11
12// or with getElementById
13
14document.getElementById("pic1").src= searchPic.src;
15
16// jQuery to archive this,
17$("#pic1").attr("src", searchPic.src);
18
1<a href='#' onclick='edit()'><img src="../template/edit.png" id="edit-save"/></a>