<html>
<head>
<script>
var loadFile = function(event) {
var output = document.getElementById('output');
output.src = URL.createObjectURL(event.target.files[0]);
};
</script>
</head>
<body>
<input type="file" accept="image/*" onchange="loadFile(event)">
<img id="output" width="100px" height="150px"/>
</body>
<head>
<script>
var loadFile = function(event) {
var output = document.getElementById('output');
output.src = URL.createObjectURL(event.target.files[0]);
};
</script>
</head>
<body>
<input type="file" accept="image/*" onchange="loadFile(event)">
<img id="output" width="100px" height="150px"/>
</body>
No comments:
Post a Comment