title: I want to disabled remaining select options from my dropdown of select2() library
body: <p>I want to disable remaining select options from my dropdown of <code>select2()</code> library but I can't. I am generating a dynamic list of some brands in which I have some values like "All brands", "Honda", "Accord" etc., I want to disable all the select options if a user checks "all brands".</p>
  
  <p>How can I do this?</p>
  
  <p>Here's my jQuery code: </p>
  
  <pre><code>$("select.select2").change(function () {
      var selectedCountry = $(this).val();
  
      if (selectedCountry == 'all_brands') {
          $("dynamicList").prop("disabled", true)
      }
  });
  </code></pre>
  
  <p>And this is my HTML &amp; PHP code:</p>
  
  <pre><code>&lt;label class="text-danger"&gt;Select Brands&lt;/label&gt;
  &lt;select class="form-control select2" id="brandAll" multiple="multiple" name="brand_id" data-placeholder="Select Brand to Deal" style="width: 100%;"&gt;
      &lt;option value="all_brands" id="checking123"&gt;All Brands&lt;/option&gt;
      &lt;?php 
      foreach ($brand_list as $brand) {
          echo "&lt;option value='$brand-&gt;id' class='dynamicList'&gt;$brand-&gt;name&lt;/option&gt;";
      }
  ?&gt;
  &lt;/select&gt;
  </code></pre>