In a template, the following structure is automatically generated and
$(".checkbox-newsletter").change(function() {
alert('oi');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divclass="icheckbox_minimal checked" aria-checked="true" aria-disabled="false" style="position: relative;">
<input type="checkbox" id="checkbox-newsletter-1" class="checkbox-newsletter" name="FinlegadoPessoaContato[ativo_newsletter]" value="1" data-id="1" style="position: absolute; opacity: 0;">
<ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; border: 0px; opacity: 0; background: rgb(255, 255, 255);">
</ins>
</div>
I will need to make an AJAX call when the checkbox has its status changed. In a conventional way, the event is not activated because the% wrapper% is who controls the% wrap effect.
How do I capture the checkbox event?