Selectpicker deselect all. selectpicker('selectAll'); } else { control. Everything works up to the point where the first option ...