How I can get multiple checkbox data-attribute (only checked)?
I can get checkbox values, but not data attribute:
<script type="text/javascript">
//export upc
$('#export_upc').click(function(){
var arr = $('.checkboxes:checked').map(function(){
return this.value;
}).get();
console.log(arr);
});
</script>
I tried return this.data("upc"), but this is not working.
$(this).data('upc')orthis.dataset.upc