вот мой код питался сделать удаление не получается
const wrapper = document.querySelector('.img__wrapper');
function donwload(input) {
let file = input.files[0];
let fileName = input.files[0].name;
let reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function () {
const img = document.createElement('img');
wrapper.appendChild(img);
img.alt = fileName;
img.src = reader.result;
}
}
function removeImg() {
wrapper.appendChild(img).remove()
}
-
Вопрос задан
-
99 просмотров