<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<input type="file" id='file'; onchange="c()">
<img src="" id='show'>
</body>
<script type="text/javascript">
function c () {
var r= new FileReader();
f=document.getElementById('file').files[0];
r.readAsDataURL(f);
r.onload=function (e) {
document.getElementById('show').src=this.result;
};
}
</script>
</html>