checkbox event not working from datatable wrapper
checkbox event not working from datatable wrapper

I added the checkbox inside datatable wrapper.
var example = $('#example').DataTable({
"dom": '<"toolbar">frtip',
"paging": false,
data: .....
});
$("div.toolbar").html('<input type="checkbox" id="basic_checkbox_2" class="filled-in" /><label for="basic_checkbox_2"> Set default time in /out for all.</label>');
now i am trying to trigger change event for checkbox
$('#basic_checkbox_2').change(function () {
if (this.checked) {
...
} else {
...
}
});
but it is not working ....
Answers
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin