title: Sort checkboxes based on their values (in specific order)
body: <p>I have checkboxes that are placed in a particular order by a wordpress plugin.</p>
  
  <p>The generated HTML code looks like this:</p>
  
  <pre><code>&lt;div class="wpgmza_filter_container" id="wpgmza_filter_container_5"&gt;
          &lt;div class="wpgmza_cat_checkbox_holder wpgmza_cat_checkbox_5"&gt;
              &lt;div class="wpgmza_cat_checkbox_item_holder_first"&gt;
                  &lt;input type="checkbox" class="wpgmza_checkbox form-control" id="wpgmza_cat_checkbox_0" name="wpgmza_cat_checkbox" mid="5" value="0"&gt;
                  &lt;div&gt;
                      &lt;label for="wpgmza_cat_checkbox_0"&gt;All&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="wpgmza_cat_checkbox_item_holder"&gt;
                  &lt;input type="checkbox" class="wpgmza_checkbox form-control" id="wpgmza_cat_checkbox_2" name="wpgmza_cat_checkbox" mid="5" value="2"&gt;
                  &lt;div&gt;
                      &lt;label for="wpgmza_cat_checkbox_2"&gt;Airco&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="wpgmza_cat_checkbox_item_holder"&gt;
                  &lt;input type="checkbox" class="wpgmza_checkbox form-control" id="wpgmza_cat_checkbox_3" name="wpgmza_cat_checkbox" mid="5" value="3"&gt;
                  &lt;div&gt;
                      &lt;label for="wpgmza_cat_checkbox_3"&gt;Vent&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="wpgmza_cat_checkbox_item_holder"&gt;
                  &lt;input type="checkbox" class="wpgmza_checkbox form-control" id="wpgmza_cat_checkbox_5" name="wpgmza_cat_checkbox" mid="5" value="5"&gt;
                  &lt;div&gt;
                      &lt;label for="wpgmza_cat_checkbox_5"&gt;Sun&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="wpgmza_cat_checkbox_item_holder"&gt;
                  &lt;input type="checkbox" class="wpgmza_checkbox form-control" id="wpgmza_cat_checkbox_1" name="wpgmza_cat_checkbox" mid="5" value="1"&gt;
                  &lt;div&gt;
                      &lt;label for="wpgmza_cat_checkbox_1"&gt;One&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>The following code sorts based (from high to low) based on value:</p>
  
  <pre><code>function sortByID(a, b)
  {
  return (a.children(“input”).val() &gt; b.children("input").val()) ? 1 : -1;
  }
  
  var container = jQuery("div.wpgmza_filter_container");
  container.children("div").sort(sortByID).appendTo(container);
  </code></pre>
  
  <p>Is it possible to sort them based on a list of values I define?
  I want them to be displayed in this order (value-based):
  3,5,0,1,2</p>