Search
 
SCRIPT & CODE EXAMPLE
 

HTML

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>
Comment

input file img / input file image

<div class="image-upload">
  <label for="file-input">
    <img src="https://icons.iconarchive.com/icons/dtafalonso/android-lollipop/128/Downloads-icon.png"/>
  </label>

  <input id="file-input" type="file" />
</div>


 // CSS

.image-upload>input {
  display: none;
}
Comment

PREVIOUS NEXT
Code Example
Html :: iframe youtube autoplay not working 
Html :: bootstrap center button horizontally 
Html :: how to automatically redirect in html 
Html :: html inbed youtube 
Html :: non breaking space html 
Html :: regex to remove html tags python 
Html :: svg circle 
Html :: flexbox bootstrap 4 
Html :: icons burger css font awesome 
Html :: twig join 
Html :: html option disabled 
Html :: fullpage cdn 
Html :: html pi symbol 
Html :: how to add icon to custom page tab 
Html :: how to make a divide sign in html 
Html :: html importer une image 
Html :: hyperlink html 
Html :: bold in bootstrap 
Html :: html sms link 
Html :: min number input html 
Html :: html inline comment 
Html :: datalayer push 
Html :: html input type file accept excel 
Html :: Bootstrap Carousel Image Not Display in Full Width 
Html :: nuxt input image base64 
Html :: ngxcountup suffix 
Html :: json-ld for portfolio site 
Html :: how to redirect to gmail with a tag html 
Html :: foreach jstl 
Html :: input width autosize 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =