title: jQuery - removeClass not work when element have multiple class
body: <p>Hi I have problem with <code>removeClass()</code> function.
  What I need is every check/uncheck action on specified checkbox element should in <code>select</code> field below, add or remove class defined by the value of clicked checkbox. Unfortunately this works fine only when you make click action alternately at both checkboxes. When <code>option</code> element have multiple classes and you click same checkbox which you have previously clicked, classes do not want to be removed.</p>
  
  <p>Thank You for every explanation of this issue and help to fix it.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;span&gt;
    &lt;input class="checkbox" type="checkbox" value="1" &gt; &lt;label for="bahn_1"&gt;CB 1&lt;/label&gt;
  &lt;/span&gt;
  &lt;span&gt;
    &lt;input class="checkbox" type="checkbox" value="2" &gt; &lt;label for="bahn_2"&gt;CB 2&lt;/label&gt;
  &lt;/span&gt;
  
  &lt;select class="select" name="start_1" required&gt;
    &lt;option value="" selected disabled&gt;Choose option&lt;/option&gt;
    &lt;option value="15:00"&gt;15:00&lt;/option&gt;
    &lt;option value="16:00"&gt;16:00&lt;/option&gt;
    &lt;option value="17:00"&gt;17:00&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>&lt;script&gt;
  $('.checkbox').click(function() {
  
    var thisVal = $(this).val();
    checked = $(this).is(":checked");
  
    if(checked) {
  
          $('select').find('option[value="16:00"]').addClass('class' + thisVal);
  
    } else {
  
      $("select").find("option[class^='class" + thisVal + "']").each(function(){
  
          $("select option[class^='class" + thisVal + "']").removeClass("class" + thisVal);
  
      });
  
    }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>jsFiddle</strong></p>
  
  <p><a href="https://jsfiddle.net/X9DESIGN/ahprcn03/16/" rel="nofollow noreferrer">https://jsfiddle.net/X9DESIGN/ahprcn03/16/</a></p>
  
  <p>====</p>
  
  <p>I definitely used wrong combination of functions and selectors content. My fault. </p>
  
  <p><strong>Solution with example:</strong> </p>
  
  <p><code>$("select").find("option[class^='class" + thisVal + "']")</code> </p>
  
  <p>is wrong, but </p>
  
  <p><code>$("select option.class" + thisVal)</code> </p>
  
  <p>is perfect.</p>