Answers for "change image source on input file change javascript"

11

how to change image source using javascript

document.getElementById("myImg").src = "hackanm.gif";
Posted by: Guest on February-08-2020
1

change src with inpute type="file"

<img id="output" src="" width="100" height="100">

<input name="photo" type="file" accept="image/*" onchange="document.getElementById('output').src = window.URL.createObjectURL(this.files[0])">
Posted by: Guest on March-25-2020

Code answers related to "change image source on input file change javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language