title: How to Sort a DIV OnClick Jquery by value of a custom attribute?
body: <p>This code works perfect for sorting a dynamically created div:</p>
  
  <pre><code>&lt;div id='1'&gt;a&lt;/div&gt;
  &lt;div id='2'&gt;b&lt;/div&gt;
  &lt;div id='3'&gt;c&lt;/div&gt;
  &lt;div id='4'&gt;d&lt;/div&gt;
  &lt;div id='5'&gt;e&lt;/div&gt;
  
  &lt;div id="addnew"&gt;Add New&lt;/div&gt;
  
  
  
     $('#addnew').live('click',function() {
  
      newdiv = $("&lt;div id='4'&gt;AA&lt;/div&gt;");
  
      div_id_after = Math.floor(parseFloat(newdiv.get(0).id));
  
      $('#'+div_id_after).after(newdiv);
  
  });
  </code></pre>
  
  <p>All I want to do is take this same function and make it work to use a custom attribute "data-sort=" rather than ID.</p>
  
  <p>Regards</p>