title: Ajax selecting multiple values in select2
body: <p>i am working with select 2, and i have data coming from ajax in json format.</p>
  
  <p><strong>View:</strong></p>
  
  <pre><code>&lt;select class="form-control qual_id" multiple&gt;
      &lt;option value=""&gt;-Select Degree-&lt;/option&gt;
      &lt;option value="1"&gt;SSC&lt;/option&gt;
      &lt;option value="2"&gt;HSC&lt;/option&gt;
      &lt;option value="3"&gt;BBA&lt;/option&gt;
      &lt;option value="4"&gt;MBA&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p><strong>Ajax:</strong></p>
  
  <pre><code>var defaultValue = 1,2 // (it can be one id or two ids)
  
  $(`.qual_id option[value=${defaultValue}]`).attr('selected', true);
  </code></pre>
  
  <p><strong>select2:</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $('.qual_id').select2({
    width: 'resolve',
    maximumSelectionLength: 2
  });
  &lt;/script&gt;
  </code></pre>
  
  <blockquote>
    <p>if i remove multiple from select tag and and do it without select2 with one id, it is
    working fine, but how can i do it by selecting multiple values in select.</p>
  </blockquote>
  
  <p><strong>Console:</strong></p>
  
  <blockquote>
    <p>Uncaught Error: Syntax error, unrecognized expression: .qual_id
    option[value=1,2]</p>
  </blockquote>