Comment Comment by alex7734 But why spend so much time to make it worse? on_click() { if (last_one()) alert('You must keep at least one item selected.'); else actually_toggle_it_off(); } Simple. Does not need fancy code. User immediately knows what he has to do, with no thinking required. parent alex7734 2 years ago