I am using this http://rvera.github.io/image-picker/ library and I don't know how to show the value of the src image when clicked.
Can you help me?
This is my example
$("select.image-picker.show-labels").imagepicker({
hide_select: true,
show_label: true,
clicked:function(){
console.log($(this).find("img").attr("src"));
}
});
Thanks
This should do it :
$(this).find("option[value='" + $(this).val() + "']").data('img-src');
$(this)
is the select input, you're trying to find the option which is selected and to get the img-src data attribute.
Though, are you sure you shouldn't just get the Id of the image you selected through $(this).val()
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With