I am trying to store all the checked checkboxes class names in an array to parse it using an ajax function later.
But first to make sure that all the classes being stored in the array correctly I alert them, but know, what I see is just the first checked checkbox class
there supposed to be many as the check boxes are generated dynamically .
Jquery
$(document).ready(function() {
$('#actselect').change(function() {
var conceptName = $( "#actselect option:selected" ).attr ( "id");
if (conceptName == "payall"){
var checkedB = new Array();
checkedB.push($("input.NP:checkbox:checked").attr("class"));
alert(checkedB);
}
});
HTML
a php while loop {
<input type="checkbox" value="None" id="itemselectNP" class="NP T<?php echo $productId; ?>" name="itemselect" />
}
Please let me what is wrong with my code? I have tried different solutions poped on google search but still no luck.
Appreciated