SO fiddle

Test Fiddle mainly for SO Questions

by Nick Craver

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/overcast/jquery-ui.css">
<div class="demo">

    <form>
        <div id="radio">
            <input type="radio" id="radio1" name="radio" /><label for="radio1">Choice 1</label>
            <input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2">Choice 2</label>
            <input type="radio" id="radio3" name="radio" /><label for="radio3">Choice 3</label>
        </div>
        <br/>
        <input type="button" id="mybutton" value="click me"/>
    </form>

</div><!-- End demo -->

CSS

#format { margin-top: 2em; }

JavaScript

$(function() {      
    $("#radio").buttonset();        
    $("#mybutton").button();
    $("#mybutton").click(function(){
        $("#radio1").attr("checked","checked");alert($("#radio1").attr("checked"));
        $("#radio").buttonset('refresh');
    });
    
});