jQuery Mobile: Horizontal Radio Button Group

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

To make a horizontal button set, add the data-type=’horizontal’  to the fieldset.

<!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 Radio Buttons</h1></div>
    <br>
    <p>Horizontal Radio Buttons</p>
    <form>
        <fieldset data-role='controlgroup' data-type='horizontal'>
            <input type='radio' name='radio_choice' id='radio_choice_id1' value='on' checked='checked'>
            <label for='radio_choice_id1'>One</label>
            <input type='radio' name='radio_choice' id='radio_choice_id2' value='off'>
            <label for='radio_choice_id2'>Two</label>
            <input type='radio' name='radio_choice' id='radio_choice_id3' value='other'>
            <label for='radio_choice_id3'>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: Basic Radio Buttons
jQuery Mobile: Mini Size Radio Buttons >>