Answer the question
In order to leave comments, you need to log in
How to upload file without input?
Good evening! I would like to know how you can download a file when you click on an element that is not associated with the input file.
For example
const fromCd = document.createElement('li');
fromCd.addEventListener('click',( )=>{
// Здесь как то нужно получить файл через js
})
Answer the question
In order to leave comments, you need to log in
It's quite simple, hide an invisible input on the page and click it with JavaScript when the user clicks on some other element you designate.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question