I have this javascript code:
var img = document.createElement("img");
img.setAttribute('src', 'close.png');
img.setAttribute('alt', 'cancel this file');
img.setAttribute('title', 'cancel this file');
var link = document.createElement('a');
link.setAttribute('href', '#');
link.appendChild(img);
But the result does not show the image?
Did I do anything wrong?
Thanks in advance.
the path was wrong, it should be:
img.setAttribute(‘src’, ‘img/close.png’);