Skip to content
Advertisement

update only single element while sharing same class

I have below jquery which shows an image preview from file input.

JavaScript

The above code is working well, but the problem is it updates all img elements using the same class

screenshot screenshot

blade

JavaScript

ANy suggestion to update only specific img element while using same class ?

Advertisement

Answer

Just update your readURL function like this:

JavaScript

I solved it for you on my codepen page.

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement