Как передать путь к изображению в setAttribute в Django?

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' %}" неверно. Как его исправить? Спасибо

Вернуться на верх