0
When you click a button, I need you to press my JS function. To load this function, clicking the button only works if you inform the button with the attribute onclick, stating the name of the function. When I try to access through the button class selector, the function does not press.
<button type="button" class="btn btn-danger btn-xs excl-receita"><i class="fa fa-trash"></i></button>
The JS function I intend to use:
$('.excl-receita').off('click').on('click', function () { });
Pq is using
.off
? Would just$('.excl-receita').on('click', function () { });
– Sam
With . off or without, does not work.
– user108720
Even with
.off
should work. I just questioned your use rs. It might not be working for several reasons: is the element dynamic? The code is before or after the element?– Sam
JS is loaded before the page. And the element is dynamic.
– user108720