Created
October 8, 2014 13:40
-
-
Save pixelchar/289a9ce60d3d077b7835 to your computer and use it in GitHub Desktop.
Show an image on the page after choosing it from the file browser - via http://jsbin.com/qaweka/2/edit
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
<input type="file"> | |
<img> |
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
var input = $('input')[0], | |
img = $('img')[0]; | |
$(input).on('change', function (e) { | |
img.src = URL.createObjectURL(input.files[0]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment