Guest User

Untitled

a guest
Dec 9th, 2019
163
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var sel = $('.cmb2_select'),
  2.     opt = $('option:not(:first-child)', sel);
  3.  
  4. function review(){
  5.     var chosen = sel.map(function(i, el){
  6.         return $(':selected',el);
  7.     });
  8.     var teamId = 0;
  9.     opt.show();
  10.     chosen.each(function(i, el){
  11.         teamId = $(el).val();
  12.         opt.not(el).filter(function(){
  13.             return $(this).val() == teamId;
  14.         }).hide();
  15.     });
  16.     return false;
  17. }
  18. sel.on('change',review);
RAW Paste Data