1<p><input type="file" accept="image/*" name="image" id="file" onchange="loadFile(event)" style="display: none;"></p>
2<p><label for="file" style="cursor: pointer;">Upload Image</label></p>
3<p><img id="output" width="200" /></p>
4
5<script>
6var loadFile = function(event) {
7 var image = document.getElementById('output');
8 image.src = URL.createObjectURL(event.target.files[0]);
9};
10</script>
11