Devil198711,
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style>
#preview img {
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<input id="upload" type="file" />
<div id="preview"></div>
<script>
(function() {
var inpElem = document.getElementById('upload'),
divElem = document.getElementById('preview');
inpElem.addEventListener("change", function(e) {
preview(this.files[0]);
});
function preview(file) {
if ( file.type.match(/image.*/) ) {
var reader = new FileReader(), img;
reader.addEventListener("load", function(event) {
img = document.createElement('img');
img.src = event.target.result;
divElem.appendChild(img);
});
reader.readAsDataURL(file);
}
}
})();
</script>
</body>
</html>