How to count toggled buttons in jqueryui after a click event.
- by SystemicPlural
I need to count how many buttons are toggled using the jqueryui checkbox button option - .buttonset(). This needs to happen when a button is toggled.
I added a unique class to the labels before applying the button set and have set a click event on it.
It fires fine, however it is firing before the jqueryui has processed the click so the result is out of date. How do I apply the click event after jqueryui has done its job?
$(".button-set").click(function(){
var selected = $("#offer_list_4 label[aria-pressed=true]").length; // out of date
});