Created
February 5, 2020 08:07
-
-
Save mhfaisalbd/cb30bef5f89b2298da63c96da92861bf to your computer and use it in GitHub Desktop.
This file contains hidden or 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 preview_image(imgOutputId, textOutputId, event) { | |
var reader = new FileReader(); | |
reader.onload = function () { | |
var imgOutput = document.getElementById(imgOutputId); | |
var textOutput = document.getElementById(textOutputId); | |
imgOutput.src = reader.result; | |
textOutput.value = imgOutput.src; | |
} | |
reader.readAsDataURL(event.target.files[0]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment