change image upload file when have a exists image
11:58html:
<input
id="profile-image-upload" class="hidden" type="file">
<div
id="profile-image">click here to change profile image</div>
css:
input.hidden
{
position: absolute;
left: -9999px;
}
#profile-image
{
cursor: pointer;
background: #8adffb;
width: 80px;
height: 80px;
}
js:
$(function()
{
$('#profile-image').on('click', function() {
$('#profile-image-upload').click();
});
});
https://jsfiddle.net/ksnvphu/vq2u91w6/1/
0 nhận xét