jQuery Mobile: Theme B Checkbox

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

Taking this opportunity, we look at building checkboxes with a theme.

The following example is built with theme B.

Theme B
<!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' id='pageone'>
    <div data-role='header'><h1>Checkbox App</h1></div>
    <br>

    <p>Theme B</p>
    <form>
        <fieldset data-role='controlgroup'>
            <input type='checkbox' name='checkbox_a' id='checkbox_ida' data-theme='b'>
            <label for='checkbox_ida'>One</label>
            <input type='checkbox' name='checkbox_b' id='checkbox_idb' data-theme='b'>
            <label for='checkbox_idb'>Two</label>
            <input type='checkbox' name='checkbox_c' id='checkbox_idc' data-theme='b'>
            <label for='checkbox_idc'>Three</label>
        </fieldset>
    </form>


    <div data-role='footer' data-position='fixed'>
        <h1>Footer</h1>
    </div>
</div>
</body>
</html>
Try The Code

Theme B is specified by using data-theme=’b’.

Series Navigation<< jQuery Mobile: Icon Position Right Of Checkbox
jQuery Mobile: Disabled Checkbox >>