Skip to content

Instantly share code, notes, and snippets.

Created Nov 21, 2012
What would you like to do?
Preview the image from an input file
// Call this function on the onchange event of the input
function prevVisu(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(e){
$("div#visuForm").html("<img class='img-polaroid' src='" + + "' alt='Preview du visuel'>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment