jQuery Mobile: Vertically Grouped Checkbox

This entry is part 15 of 73 in the series jQuery Mobile

Usually, we have the checkboxes arranged in vertical group format.

To integrate multiple checkboxes into a grouped button set, we put data-role=’controlgroup’ attribute on the fieldset.

Vertically Grouped Checkbox
<!DOCTYPE html>
    <link href='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css' rel='stylesheet'/>
    <script src='http://code.jquery.com/jquery-1.10.2.min.js'></script>
    <script src='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js'></script>
<div data-role='page'>
    <div data-role='header'><h1>Vertical Group Checkbox</h1></div>

    <p>Vertical Group Check Box</p>
        <fieldset data-role='controlgroup'>
            <input type='checkbox' name='checkbox-v-2a' id='checkbox-v-2a'>
            <label for='checkbox-v-2a'>One</label>
            <input type='checkbox' name='checkbox-v-2b' id='checkbox-v-2b'>
            <label for='checkbox-v-2b'>Two</label>
            <input type='checkbox' name='checkbox-v-2c' id='checkbox-v-2c'>
            <label for='checkbox-v-2c'>Three</label>
    <div data-role='footer' data-position='fixed'>
Try The Code
Series Navigation<< jQuery Mobile: Mini Size Checkbox
jQuery Mobile: Horizontal Group Checkbox >>

Leave a comment

Leave a Reply