Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
});
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #display #image #upload #jhtml
ADD COMMENT
Topic
Name
8+3 =