How do I preview the images on multiple input files.
html:
<form id="form1" runat="server">
<input type='file' id="imgInp" />
<img id="blah" src="#" alt="your image" />
<input type='file' id="imgInp2" />
<img id="blah2" src="#" alt="your image" />
<input type='file' id="imgInp3" />
<img id="blah3" src="#" alt="your image" />
</form>
jquery:
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#blah').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#imgInp").change(function(){
readURL(this);
});
That code worked on one input type file, but I do not know how to modifiy it to get more then one preview.