title: How can I validate select2 elements with using jquery validation plugin?
body: <p>I use select2 3.5.2 and jquery validation 1.13.1 .I could add error class to select2 elements with using validation plugin "highlight" method but when I select a value I can't remove that error class. How can I solve this?</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form id="test" class="frm"&gt;
      &lt;div&gt;
          &lt;input type="text" name="name" /&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;label for="singleselect"&gt;&lt;/label&gt;
          &lt;select class="sl" id="singleselect" name="singleselect"&gt;
              &lt;option&gt;&lt;/option&gt;
              &lt;option value="val1"&gt;Val-1&lt;/option&gt;
              &lt;option value="val2"&gt;Val-2&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
  
      &lt;div&gt;
          &lt;label for="multipleselect"&gt;&lt;/label&gt;
          &lt;select class="sl" id="multipleselect" name="multipleselect" multiple="multiple"&gt;
              &lt;option&gt;&lt;/option&gt;
              &lt;option value="val1"&gt;Val-1&lt;/option&gt;
              &lt;option value="val2"&gt;Val-2&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
  
      &lt;button class="btn"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>$(document).ready(function () {
  
      $('.sl').select2({
          placeholder:'Select'   
      })
  
      $.validator.setDefaults({
          ignore: []
      });
  
      $('#test').validate({
          errorElement: 'span',
          errorClass: 'error',
          rules: {
              singleselect:'required',
              multipleselect:'required',
              name:'required'
          },
  
      highlight: function (element, errorClass, validClass) {
  
          var elem = $(element);
  
          elem.addClass(errorClass);
  
      },
      unhighlight: function (element, errorClass, validClass) {
          var elem = $(element);
  
              if(elem.hasClass('sl')) {
                  elem.siblings('.sl').find('.select2-choice').removeClass(errorClass);
              } else {
                  elem.removeClass(errorClass);
              }
          }
      });
  
  });
  </code></pre>
  
  <p><a href="https://jsfiddle.net/8Lyfa3k2/6/" rel="nofollow">https://jsfiddle.net/8Lyfa3k2/6/</a></p>