Код: Выделить всё
function addDownload() {
const filename = document.getElementById("myfile").files[0].name;
console.log(filename)
let newelecment = document.createElement('a');
newelecment.setAttribute('href', 'filename')
newelecment.setAttribute('download', filename);
alert(newelecment.value)
newelecment.textContent = `${filename}`
let par = document.createElement('p');
par.appendChild(newelecment);
console.log(par.value)
document.getElementById('link').appendChild(par);
}
document.getElementById("myfile").addEventListener("input", addDownload);< /code>
Select a file:
Подробнее здесь: https://stackoverflow.com/questions/797 ... downloaded
Мобильная версия