Preview Image


To preview an image when the image is selected from input type="file", first create an <img> tag where the preview will be displayed.

You need to simply attach the following event to your input type file.

The previewImage method accepts the selector of HTML node where the preview of selected image will be displayed.