jQuery Mobile: Horizontal Group Checkbox

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

To build a horizontal group checkbox, we use the code below.

Notice the data-type=’horizontal’ attribute:

<fieldset data-role='controlgroup' data-type='horizontal'>
Horizontal Group Checkbox
<!DOCTYPE html>
<html>
<head>
    <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>
    <title>Upwhere</title>
</head>
<body>
<div data-role='page'>
    <div data-role='header'><h1>Horizontal Checkbox</h1></div>
    <br>
    
    <p>Horizontal Group Check Box</p>
    <form>
        <fieldset data-role='controlgroup' data-type='horizontal'>
            <input type='checkbox' name='checkbox_a' id='checkbox_a'>
            <label for='checkbox_a'>One</label>
            <input type='checkbox' name='checkbox_b' id='checkbox_b'>
            <label for='checkbox_b'>Two</label>
            <input type='checkbox' name='checkbox_c' id='checkbox_c'>
            <label for='checkbox_c'>Three</label>
        </fieldset>
    </form>

    <div data-role='footer' data-position='fixed'>
        <h1>Footer</h1>
    </div>
</div>
</body>
</html>
Try The Code
Series Navigation<< jQuery Mobile: Vertically Grouped Checkbox
jQuery Mobile: Icon Position Right Of Checkbox >>