I have a HTML form like this:
<form id="myForm" name="myform" action="register/index.php" method="post" enctype="multipart/form-data" >
<input class="myfile" id="banner" name="banner" type="file" accept="image/png, image/gif, image/jpeg" >
<a href="#" onclick="getPreview();>Preview</a>
<input type="submit" value="submit" name="submit">
</form>
What I want to do is when a user clicks on the preview button his chosen file will display somewhere in <div id="myid"></div>
<script>
function getPreview(){
// what should write here to make this working
}
</script>
Anyone please help in this, how to do this using jQuery or JavaScript?