开发者

jquery ui checkbox button state

If I have a group of checkbox buttons, what is the correct way to determine the button state?

Right now I do this:

$('#group label').each(function() {
    if ($(this).attr('aria-pressed') == 'true') {
        /* Do something */
    }
});

But sometimes no checkbox buttons are checked an开发者_如何转开发d some still have aria-pressed = true. I don't understand it.


Use .is(':checked') on the jQuery object containing your checkbox to test if it's checked.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜