0
Image sources
Any way to change the image source to a chosen file with the input type = file button?
4 Antworten
+ 1
If I missunderstand you want to show an <img> updating their src attribute after select it from an <input> of type=file?
+ 1
Maxwell in the MDN is well explained this case and many others like drag and drop
Tag:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file
How to...
https://developer.mozilla.org/en-US/docs/Web/API/File/Using_files_from_web_applications
1. Add a change listener to input with the code
2. In their code read the file as data url
3. set this content to your img.src attribute
Remember mark as valid if answer response/solve you requirements
0
David Ordás 🇪🇸 yep
0
David Ordás 🇪🇸 thank you so much! :)