Replace input type file by Icon/Image | Display image uploaded below icon or image | Jquery

preview_player
Показать описание
In this video , you will be able to change input type file with icon or image.

How to change the default text 'Choose file' of an input type="file"

Steps:
Create a input type file
Create a label for image
Inside label, include icon or image
define for attribute in label
create a div for displaying image uploaded
define onchange on input and get the value of image uploaded
in jquery script, define function and get the value and display the name to the div defined

label for="firstimg"
i class="fa fa-plus" style="font-size: 24px;border: 1px solid black;padding: 25px;cursor: pointer;"
/label

In script
function getImage(imagename)
{
$('#display-image').html(newimg);
}

#jquery #knowledgethrusters
Рекомендации по теме
Комментарии
Автор

Thank you so mucccchh! God bless. <3

kriziacarissepangan
Автор

how we can see the image over the div which you have made
can u help me out 😊😊😊😊😊😊

AbhishekVerma-xkbt
Автор

It will be nice is to do download like that but, to be abble to preview the image.

tiagoborges
Автор

Do we have any equivalent angular code for this?

AdityAditi
Автор

The last var one is not working for me pls help
\

sanidhyajindal
Автор

This is cool, but I have an image as input and I plan on replacing that image with one the user selects. How do I do that?

leozeld_nb
Автор

The last var one is not working for me pls help
\

sanidhyajindal