jQuery fcbkselection

Go To StackoverFlow.com

0

I am using this to select all items and check them

$("#selectAll").live('click', function() {
$("#fcbklist li .fcbklist_item:not(:has(:hidden:checked))").click();
});

That works. and to uncheck

$("#unselectAll").live('click', function() {
$("#fcbklist li .fcbklist_item:not(has(:hidden:checked))").click();
});

the unselectAll code does not work. It behaves like a toggle. Those that are checked get unchecked and those unchecked get checked.

Please what is the proper way?

Thank you.

2012-04-04 03:49
by lionel28


1

Solution was so simple. This creates a toggle

 $("#fcbklist li .fcbklist_item").click();
2012-04-05 03:30
by lionel28
Ads