2

这里的例子:

http://jsfiddle.net/UVHtu/19/

我需要填空:

HTML:

<div id="options">
    <input type="radio" id="op_a" name="op" value="a" />
    <label for="op_a">Option A</label>
    <input type="radio" id="op_b" name="op" value="b" />
    <label for="op_b">Option B</label>
    <input type="radio" id="op_c" name="op" value="c" />
    <label for="op_c">Option C</label>
</div>
<input type="button" id="disable_button" value="Disable Option B" />
​

JavaScript:

$("#options").buttonset();

$("#disable_button").click(function(){
    // What goes here to disable option B?
});

​</p>

4

1 回答 1

10
$("#options").buttonset();

$("#disable_button").click(function(){
    // What goes here?
    $('#op_b').attr("disabled", "disabled");
    $("#options").buttonset("refresh");
});
于 2012-10-23T16:14:10.363 回答