Image Upload Preview

Javascript & jQuery

by Zuhaib Siddiqui

HTML

<input type="file" onchange="imgchange(event)" />
<img id="imgs" />


<script>
function imgchange(event){
    $("#imgs").attr('src',URL.createObjectURL(event.target.files[0]));
}
</script>