test.addEventListener('click',function(e){
console.log("click");
var targetElement = event.target || event.srcElement;
clickedVal = targetElement.innerText;
targetElement.innerText="";
input = document.createElement("input");
input.value = clickedVal;
targetElement.append(input);
img = document.createElement("img");
// It's not working here
// "{% static 'images/confirm.svg' %}" is incorrect. Then how to correct it?
img.setAttribute("src", "{% static 'images/confirm.svg' %}");
input.parentElement.append(img);
})
"{% static 'images/confirm.svg' %}" is incorrect. Then how to correct it? Thanks
UPdate:
img.setAttribute("src", "{% static 'images/confirm.svg' %}");
will result in:
<img src ="{% static 'images/confirm.svg' %}" >
I guess the template engine forgot to translate.