Last active
August 26, 2016 17:49
-
-
Save igotit-anything/90ea1095c785a41dd8409bd92d86c6f7 to your computer and use it in GitHub Desktop.
JavaScript. Local Image Show
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
<script> | |
var loadFile = function(event) { | |
var output = document.getElementById('id_viewimg'); | |
output.src = URL.createObjectURL(event.target.files[0]); | |
}; | |
</script> | |
<input type="file" onchange="loadFile(event)"/> | |
<img id="id_viewimg" src="images/photo.gif" name="preview" border="0" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment