Search
 
SCRIPT & CODE EXAMPLE
 

HTML

how to get the image from file input jquery

HTML:

<form id="form1" runat="server">
   <input type='file' id="imgInp" />
   <img id="blah" 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);
});
Comment

PREVIOUS NEXT
Code Example
Html :: passing an amount to a donation radio button html code 
Html :: Show all the tags 
Html :: liveweaver 
Html :: how to create warranty page on a web page using html 
Html :: html to text 
Html :: internal phone input 
Html :: svm e1071 cutoff 
Html :: convert haml to html 
Html :: PC JS 
Html :: como ir para outra página em html 
Html :: how to add extra line in html 
Html :: etiqueta blockquote en html5 
Html :: close button 
Html :: create external application revit api 
Html :: how to do auto download when you click on a link 
Html :: html semantic 
Html :: picture html tag 
Html :: 2step 
Html :: ms crm aadhar number validation javascript 
Html :: ::all() 
Html :: Load webpage from html string 
Html :: =rept sheet 
Html :: table align center not working in github 
Html :: what is bootstrap loader 
Html :: color ful scroll bar 
Html :: email validation html pattern 
Html :: do not translate page html 
Html :: Consider adding a lang attribute to the html start tag to declare the language of this document. 
Html :: group by design bold vuetify table 
Html :: angular mattooltip conditional formatting 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =