<input type="file" id="selectedPhoto" name="profilepicuploader1"
onclick="PreviewImage();" accept="image/*" />
<img id="profileImage" >
Here is my script:
function PreviewImage() {
document.getElementById('selectedPhoto').onchange = function(evt) {
ImageTools.resize(
this.files[0],
{
width: 150, // maximum width
height:150 // maximum height
},
function(blob, didItResize) {
// didItResize will be true if it managed to resize it, otherwise
//false (and will return the original file as 'blob')
document.getElementById('profileImage').src=window.URL.createObjectURL(blob);
})
};
}
The above code is resized the image and show the preview image using document.getElementById('profileImage').src = window.URL.createObjectURL(blob);
but I want assign preview image value into input file
type
plz help me thanks in advance