title: How do I get the each method to work with multiple inputs using MagicSuggest?
body: <p>I have 3 fields that MagicSuggest will be acting on. I have it set so that when there is a value in the input, a class called 'filled' will activate and leave the label above its respective input. The problem is that this 'filled' class gets added to every other input using MagicSuggest. I just want it for the individual input.</p>
  
  <p><a href="http://codepen.io/shimizurei/pen/qzjrA" rel="nofollow">Here is a pen</a> that contains my problem.</p>
  
  <p>What I have tried:</p>
  
  <pre><code>//Try #1
  $(maa, baa, laa).each(function(){
    $(maa, baa, laa).on('selectionchange', function(e, m){
      var this = $(this).closest('.ms-ctn');
      $(this).addClass('filled');
    });
  });
  
  //Try #2
  $(maa).on('selectionchange', function (e, m) {
    $('.ms-sel-ctn').each(function(){
      $(this).closest('.ms-ctn').addClass('filled');
    });
  });
  
  //Try #3
  $(maa).on('focus', function (c) {
    $('ms-sel-ctn').closest('.ms-ctn').addClass('filled');
  });
  
  //Try #4
  $('.magsug').each(function () {
    var xxx = $(this).magicSuggest({});
    $(xxx).on('selectionchange', function(event, combo, selection) {
      $('.ms-sel-ctn').closest('.ms-ctn').addClass('filled');
    });
  });
  
  //Try #5
  $('.magsug').each(function () {
    var ms = $(this).magicSuggest({});
    $(ms).on('selectionchange', function (e, m) {
      $('.ms-sel-ctn').each(function(){
        $(this).closest('.ms-ctn').addClass('filled');
      });
    });
  });
  </code></pre>
  
  <p>I found a similar question on the <a href="https://github.com/nicolasbize/magicsuggest/issues/46" rel="nofollow">issues</a> page in github and tried to implement it (Try #5), but it didn't work for me. I'm learning JavaScript, so sorry for any apparent errors. Thank you for your assistance.</p>