我尝试添加一个select all选项。出于某种原因,我只能选择尚未选择的下一个选项,而不是所有选项。有什么想法吗?
// select all chosen
$(document).on('click', '.group-result', function() { //modify this to be based off of superheroes
var unselected = $(this).nextUntil('.group-result').not('.result-selected');
if(unselected.length) {
unselected.trigger('mouseup'); //bug - only selects one at a time
}
});