Checkbox function inside table not working

With display:none the checkbox is still physically present so that would not be the reason. It is probably that you are running that JavaScript even before the checkboxes have rendered. You can do one of two things:

  1. add your script after the table HTML
  2. wrap your code in an on document ready event listener:
$( document ).ready(function() {
  var checkboxes = $(".checkbox");
  console.log('checkboxes found:', checkboxes.length);
  // You may not need to run the loop so this may suffice: $(".checkbox").on('change' ...
});
1 Like