DEV Community

Cover image for How to Preview image before uploading in Javascript

How to Preview image before uploading in Javascript

Shantanu Jana on September 11, 2021

In this article, I am going to show you how to create a custom image upload and preview design. Image Preview is a great system where you can check...
Collapse
 
rkfr profile image
Roman

Why you're using var in 2021?

Collapse
 
fmagrosoto profile image
Fernando Magrosoto

Wow!, very clever approach for rendering image preview. Thanks!

Collapse
 
shantanu_jana profile image
Shantanu Jana

Welcome 😀

Collapse
 
makavelithadon profile image
makavelithadon • Edited

Great article !! Very useful 👌
But maybe you can use the DOM 2 spec for attaching event on DOM node by doing:

element.addEventListener("change", event => /* Do something with event arg */);
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ibrahimadesoye profile image
Ibro Makanaki

Very informative, educative with new innovations Coding article.

Good job!

Collapse
 
shantanu_jana profile image
Shantanu Jana

Thank you 😍

Collapse
 
rohitgarg profile image
Rohit Garg

Very Informative. Thanks for sharing

Collapse
 
70hackers profile image
70hackers

Awesome 😎👍

Collapse
 
shantanu_jana profile image
Shantanu Jana

Thank you

Collapse
 
brilliance profile image
Brilliance Oparaku

Oh wow, been too lazy to look this up because I felt it was more complicated, thanks for making this a breeze. Thanks a lot :)

Collapse
 
foundmissing01 profile image
Found Missing_59

what if i want to add multiple image
how will i go with that