var img = new Image(); img.src = 'image.png'; img.onclick = function() { window.location.href = 'http://putyourlocationhere/'; }; document.body.appendChild(img);