Answers for "how to display image in image as soon as we upload in file uploder in html"

3

how to display image before upload in jhtml

function display(input) {
   if (input.files && input.files[0]) {
      var reader = new FileReader();
      reader.onload = function(event) {
         $('#myid').attr('src', event.target.result);
      }
      reader.readAsDataURL(input.files[0]);
   }
}

$("#demo").change(function() {
   display(this);
});
Posted by: Guest on October-17-2020

Code answers related to "how to display image in image as soon as we upload in file uploder in html"

Code answers related to "Javascript"

Browse Popular Code Answers by Language