use Jquery to check checkbox in Jquery buttonset
I have some checkboxes in a button set and I want to use Jquery to check one of the checkboxes.
It works, however, the visual representation of the checkbox does not update. ie, after executing $('#chk').attr('checked',true);
the checked value is true, but the checkbox apears unchecked.
Demoed here: http://jsfiddle.net/kralco626开发者_运维百科/jzVjT/1/
Thanks!
You need to call the refresh
method on the buttonset to update the visual state after programmatic changes to the checked
state, like this:
$("#test").buttonset("refresh");
You can test it out here.
Try
'true'
rather than
true
Attributes are always string values.
Edit:
Never mind. No clue on buttonset functionality but things aren't behaving normally. Check the documentation for the API.
精彩评论