Menu
I am trying to change a src from img tag inside javascript code. My html code is the following
[CODE]
<div>
<img id = ‘op’ src = ‘2.png’>
</div>
and script code
[CODE] var image = 1;
var open = ‘images/’+image+’.png’;
console.log(open);
document.getElementById(“op”).src = open;
I got the message in the condole Cannot set property ‘src’ of null. Ant idea??