javascript file preview
function display(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function(event) {
$('#myid').attr('src', event.target.result);
}
reader.readAsDataURL(input.files[0]);
}
}
$("#demo").change(function() {
display(this);
});stackoverflow.com
Also in JavaScript:
- How do you detect whether or not a word is a palindrome in javascript
- js canvas draw polygon
- Delete Properties from a JavaScript Object
- jquery use variable in string
- jquery add remove class clicked element
- how many else statements can be added in javascript
- javascript best way to loop through array
- hoisting in javascript
- jquery get aria-label value
- Pass functions, not strings, to setTimeout() and setInterval()
- scrollto angular
- javascript create array of objects with key
- select 2nd td jquery
- js array last element
- format number thousands k javascript
- 'userprofile/:id', ionic
- next.js with material ui
- app.js:38650 [Vue warn]: Failed to mount component: template or render function not defined
- how to make a div sticky using js
- call javascript function after page load complete
- conditional rendering with radio buttons
- scoll a div to bottom in angular
- remove all spaces from a string javascript
- computed property name javascript