Created
February 6, 2018 02:12
-
-
Save malikkurosaki/b075e0ad6ad3649a4916ed28ea78a847 to your computer and use it in GitHub Desktop.
this simple function how to show image before upload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function preimg(){ | |
var fileimage = document.getElementById("fileimage"); | |
var showimage = document.getElementById("showimage"); | |
fileimage.addEventListener("change",function(){ | |
showimage.src = window.URL.createObjectURL(this.files[0]); | |
}); | |
} | |
preimg(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment