I have the following jQuery code:
Working code
if(report==='Group 1'){
$('.spandiv').not(':eq(17)').remove();
}
This works fine and removes all checkboxes that don't equal 17. However what I am trying to do now is only remove certain checkboxes.
I have tried the following:
Non-working code
if(report==='Group 1'){
$('.spandiv').is(':eq(17)').remove();
$('.spandiv').is(':eq(16)').remove();
$('.spandiv').is(':eq(12)').remove();
$('.spandiv').is(':eq(6)').remove();
$('.spandiv').is(':eq(5)').remove();
$('.spandiv').is(':eq(4)').remove();
}
I had assumed (clearly incorrectly) that this would work but it doesn't. I am clearly doing something wrong and would appreciate any feedback/ assistance.
$('.spandiv:eq(17)').remove();?