S.no | Contents-topics |
---|---|
1 | Introduction |
2 | HTML code |
Preview an image before uploading using jQuery we are going to use the JavaScript constructor FileReader() to read the image provided and then we shall display it. We have used img tag to display the image we get from the file we upload. Then we used FileReader() to get the file and then we used reader.readAsDataURL(file) to read the file as it is a image file or not.
Also read:DOM ELEMENTS IN JQUERY
HTML code Copy
Also read:ENABLE/LOAD AND DISABLE CSS USING JQUERY
Output of Preview an image before uploading:
0 Comments (Please let us know your query)