1var input = document.getElementById("inputFile");
2var fReader = new FileReader();
3fReader.readAsDataURL(input.files[0]);
4fReader.onloadend = function(event){
5 var img = document.getElementById("yourImgTag");
6 img.src = event.target.result;
7}