var temp = document.getElementById('path').innerHTML; var imgpath = "https://www.arcthrift.com/images/"+temp+"/04.jpg"; document.getElementById("weekimg").src = imgpath;