-1
I need to get the value that is inside product-id.
</thead>
<tr>
<td>
<button onclick="loading('carregando');" produto-id="70056057210" type="button" class="btn btn-info click-produto" data-toggle="modal" data-target="#myModal"></button>
</td>
I’ve tested it in a number of ways:
$(function(){
$(document).on('click', '.btn-danger', function(e) {
e.preventDefault;
var id = $(this).closest('tr').find('td[produto-id]').data('id');
alert(id);
});
});
And Below The Button:
<td><button class="btn-danger">Recuperar Id</button></td>
However I Receive
"Undefined"
On Alert How Should I Proceed?
Please avoid long discussions in the comments; your talk was moved to the chat
– Guilherme Nascimento