开发者

use Jquery to check checkbox in Jquery buttonset

开发者 https://www.devze.com 2023-01-29 06:17 出处:网络
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 $(\'#

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消