[Solved] How use Jquery checkbox value and Class attribute set arrays


You can do this as :

$(document).ready(function () {

    $('.checkboxes input[type="checkbox"]').change(function () {
        var A = new Array();
        var B = new Array();
        var C = new Array();
        var param = $(this).attr('class');
        $(" input[type="checkbox"]:checked").each(function () {
            if ($(this).hasClass('A')) {
                A.push($(this).attr("value"));
            }
            if ($(this).hasClass('B')) {
                B.push($(this).attr("value"));
            }
            if ($(this).hasClass('C')) {
                C.push($(this).attr("value"));
            }
            });
            //alert("value ===> " + mycheck + " ===> parameter ===> "+param);
            alert("parameter ===> A ===> value ===>" + A +
                  "\nparameter ===> B ===> value ===>" +B +
                  "\nparameter ===> C ===> value ===>" +C 
                 );
            });
        });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div class="checkboxes">
    <input type="checkbox" value="a1" class="A"/> a
    <input type="checkbox" value="a2" class="A"/> a
    <input type="checkbox" value="a3" class="A"/> a
    <input type="checkbox" value="a4" class="A"/> a
    <input type="checkbox" value="a5" class="A"/> a
    <input type="checkbox" value="a6" class="A"/> a
</div>
<br>
<div class="checkboxes">
    <input type="checkbox" value="b1" class="B"/> b
    <input type="checkbox" value="b2" class="B"/> b
    <input type="checkbox" value="b3" class="B"/> b
    <input type="checkbox" value="b4" class="B"/> b
    <input type="checkbox" value="b5" class="B"/> b
    <input type="checkbox" value="b6" class="B"/> b
</div>
<br>
<div class="checkboxes">
    <input type="checkbox" value="c1" class="C"/> c
    <input type="checkbox" value="c2" class="C"/> c
    <input type="checkbox" value="c3" class="C"/> c
    <input type="checkbox" value="c4" class="C"/> c
    <input type="checkbox" value="c5" class="C"/> c
    <input type="checkbox" value="c6" class="C"/> c
</div>

solved How use Jquery checkbox value and Class attribute set arrays