title: How auto sort checkbox list in html
body: <p>In my HTML form default checkbox and other add dynamically but when check checkbox after checkbox order in list shuffled. How to sort this in As-sending order when load page.</p>
  
  <p>HTML Code is Here:</p>
  
  <pre><code>&lt;div class="checkbox-list" style="width: auto; height: 100px; overflow-y: scroll;"&gt;
     &lt;label&gt;&lt;div class="checker" id="uniform-ch2"&gt;&lt;span&gt;&lt;input type="checkbox" id="ch2" name="data[chk_name][]" value="Further Review"&gt;&lt;/span&gt;&lt;/div&gt;Further Review&lt;/label&gt;
     &lt;label&gt;&lt;div class="checker" id="uniform-ch3"&gt;&lt;span&gt;&lt;input type="checkbox" id="ch3" name="data[chk_name][]" value="Hot Doc"&gt;&lt;/span&gt;&lt;/div&gt;Hot Doc&lt;/label&gt;
     &lt;label&gt;&lt;div class="checker" id="uniform-ch4"&gt;&lt;span&gt;&lt;input type="checkbox" id="ch4" name="data[chk_name][]" value="Potential Exhiit"&gt;&lt;/span&gt;&lt;/div&gt;Potential Exhibit&lt;/label&gt;
     &lt;label&gt;&lt;div class="checker" id="uniform-ch1"&gt;&lt;span class="checked"&gt;&lt;input type="checkbox" id="ch1" name="data[chk_name][]" checked="" value="Relevant"&gt;&lt;/span&gt;&lt;/div&gt;Relevant&lt;/label&gt;                             
     &lt;label&gt;&lt;div class="checker" id="uniform-ch5"&gt;&lt;span class="checked"&gt;&lt;input type="checkbox" id="ch5" name="data[chk_name][]" checked="" value="test"&gt;&lt;/span&gt;&lt;/div&gt;test&lt;/label&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>JavaScript Code File : </p>
  
  <pre><code> $(".checkbox-list lable").sort(function(a, b) {
     return parseInt(a.id) - parseInt(b.id);
     }).each(function() {
     var elem = $(this);
     elem.remove();
     $(elem).appendTo(".checkbox-list");
   });
  </code></pre>
  
  <p>Sort Order by id="uniform-ch2" Asc.</p>