I have <input type="file">
tag. I need to select an image and change the background of the开发者_如何学运维 image to the input image without refreshing or reloading the page. Is it possible ? If yes, how to do it ?
It is possible, but you'd have to make an AJAX file uploader - Javascript can't access the contents of a file input any any meaningful way.
You can use jQuery and do this:
$('#imgID').attr ('src', 'new path');
That will change the image without reloading the page.
精彩评论