HTML:
<button class="btn btn-sm green btn-outline filter-submit margin-bottom" data-type="Invoice Generate" onclick="show_modal()"><i class="fa fa-envelope"></i></button>
jQuery:
function show_modal(){
alert($(this).data("type"));
$('#basic').modal('show');
}
Output:
Undefined
Expected Output:
Invoice Generate
Anyone can please tell me why it alerting undefined and How can I resolve it?