jQuery Mobile 1.4.3 - Checkboxes exemple

HTML

<link rel="stylesheet" href="http://demos.jquerymobile.com/1.4.3/css/themes/default/jquery.mobile-1.4.3.min.css">
<script src="http://demos.jquerymobile.com/1.4.3/js/jquery.mobile-1.4.3.min.js"></script>
<div data-role="page" id="chk">
    <div data-role="header"> <a href="#sc" data-icon="home">CSA</a>
         <h1>katalin_2003</h1>
    </div>
    <div data-role="content">
        <fieldset class="ui-grid-c">
            <div class="ui-block-a">
                <input type="button" id="button1" data-theme="b" value="check all" />
            </div>
            <div class="ui-block-b">
                <input type="button" id="button2" data-theme="b" value="uncheck all" />
            </div>
            <div class="ui-block-c">
                <input type="button" id="button3" data-theme="b" value="check grp1" />
            </div>
            <div class="ui-block-d">
                <input type="button" id="button4" data-theme="b" value="check grp2" />
            </div>
        </fieldset>
        <div data-role="collapsible" data-collapsed="true" data-content-theme="a">
             <h4>grp1</h4>

            <fieldset data-role="controlgroup">
                <input type="checkbox" grp="1" name="checkboxArr1[]" id="checkbox-v-1a" data-theme="b" />
                <label for="checkbox-v-1a">One</label>
                <input type="checkbox" grp="1" name="checkboxArr1[]" id="checkbox-v-1b" data-theme="b" />
                <label for="checkbox-v-1b">Two</label>
                <input type="checkbox" grp="1" name="checkboxArr1[]" id="checkbox-v-1c" data-theme="b" />
                <label for="checkbox-v-1c">Three</label>
            </fieldset>
        </div>
        <div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="b">
             <h4>grp2</h4>

            <fieldset data-role="controlgroup">
                <input type="checkbox" grp="2" name="checkboxArr2[]" id="checkbox-v-2a" data-theme="a" />
                <label...

JavaScript

$(document).on("pageinit", function (e) {
    $('#button1').on("click", function () {
        $('#chk input[type=checkbox][grp=1], #chk input[type=checkbox][grp=2]').prop('checked', true).checkboxradio('refresh');
        console.log('ALL checked');
    });
    $('#button2').on("click", function () {
        $('#chk input[type=checkbox][grp=1], #chk input[type=checkbox][grp=2]').prop('checked', false).checkboxradio('refresh');
        console.log('ALL UNchecked');
    });
    $('#button3').on("click", function () {
        $('#chk input[type=checkbox][grp=1]').prop('checked', true).checkboxradio('refresh');
        $('#chk input[type=checkbox][grp=2]').prop('checked', false).checkboxradio('refresh');
        console.log('grp1 checked');
    });
    $('#button4').on("click", function () {
        $('#chk input[type=checkbox][grp=2]').prop('checked', true).checkboxradio('refresh');
        $('#chk input[type=checkbox][grp=1]').prop('checked', false).checkboxradio('refresh');
        console.log('grp2 checked');
    });
});