Use following:
Html:
<input type="file" id="Upload_Image" name="Upload_Image"/>
<img id="Upload_Image_Preview"/>
Script:
$(document).ready(function () {
document.getElementById('Upload_Image').onchange = function () {
var src = URL.createObjectURL(this.files[0]);
if (src) {
document.getElementById('Upload_Image_Preview').src = src;
$(this).css("display", "none");
}
}
});
Posted On:
25-May-2021 22:49