How to upload image in html form | CodeTextPro - CodeTextPro | Free Web Tutorial

Codetextpro Provides free Web tutorial, HTML, CSS, C, C++, Java, JavaScript, PHP, MySql, Python, Program, Programming Notes, Programming Questions and more.


Friday, January 11, 2019

How to upload image in html form | CodeTextPro

In this program, you will learn how to upload an image in your HTML form and you can see the image that you upload.


<script type="text/javascript" src=""></script>
<script type="text/javascript">
$(function () {
function imageIsLoaded(e) {
<input type="reset" value="Cancel">

<body bgcolor="yellow">
<center><h1>Submit Your Query</h1>
Name:<input type="text" name="usrname">
<textarea rows="4" cols="50">
Enter text here...</textarea><br><br>
<input type='file' />
<img id="myImg" src="#" alt="
Your Image" width="200" height="150" />

    $(":file").change(function () {
        if (this.files && this.files[0]) {
            var reader = new FileReader();
            reader.onload = imageIsLoaded;

<input type="submit" value="Submit">


No comments:

Post a Comment