How to get two different array checkbox value in Jquery?.
- by boss
Hi.. For example i have 5 checkbox, 3 checkbox with name=a[] and 2 checkbox with name=b[], if i checked array a[] 3checkbox iam getting the same value for b[] checkbox even b[] checkbox not checked. please suggest...
For ur reference:
var selectedAItems = new Array();
$("input[@name='a[]']:checked").each(function() {
selectedAItems.push($(this).val());
});
var selectedBItems = new Array();
$("input[@name='b[]']:checked").each(function() {
selectedBItems.push($(this).val());
});
alert(selectedAItems);
alert(selectedBItems );