select2 restric 5 selection code example Example: select2 restric 5 selection $("#tags").select2({ maximumSelectionLength: 3 });