Answers for "input file accexp all images"

15

input type="file" and display image

<p><input type="file"  accept="image/*" name="image" id="file"  onchange="loadFile(event)" style="display: none;"></p>
<p><label for="file" style="cursor: pointer;">Upload Image</label></p>
<p><img id="output" width="200" /></p>

<script>
var loadFile = function(event) {
	var image = document.getElementById('output');
	image.src = URL.createObjectURL(event.target.files[0]);
};
</script>
Posted by: Guest on June-08-2020
5

html make file input only images

<input type="file" accept="image/*">
Posted by: Guest on July-08-2021

Code answers related to "input file accexp all images"

Browse Popular Code Answers by Language