jQuery - order DIVs depending on an extracted number of a classname
<p>I have a list of DIVs, like this :</p>

<pre><code>&lt;div id="list"&gt;
    &lt;div class="classA classB SORT-4.2"&gt;&lt;div&gt;4&lt;/div&gt;&lt;/div&gt;
    &lt;div class="classA SORT-3.3"&gt;&lt;div&gt;3&lt;/div&gt;&lt;/div&gt;
    &lt;div class="classC classD classE SORT-5.1"&gt;&lt;div&gt;5&lt;/div&gt;&lt;/div&gt;
    &lt;div class="classB classC SORT-1.5"&gt;&lt;div&gt;1&lt;/div&gt;&lt;/div&gt;
    &lt;div class="classA class B class C SORT-2.4"&gt;&lt;div&gt;2&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>and I want to sort them, using jQuery</p>

<p>Server-side, I can define the wanted order, and include this order in the class names :</p>

<p>SORT-<strong>4.2</strong></p>

<p>I want to be able to call either the first order (in my example this DIV will be in the 4th position), or the second order (it will be in the 2nd position) : that explains the "4.2"</p>

<p>So if I call <code>OrderDIV(1)</code> I will have this :</p>

<pre><code>1
2
3
4
5
</code></pre>

<p>and if I call <code>OrderDIV(2)</code> I will have this :</p>

<pre><code>5
4
3
2
1
</code></pre>

<p>(I will need to add more orders, like : SORT-4.2.5.6.2)</p>

<p>As you can see DIVs can have multiple classes, only the pattern <code>SORT-</code> defines the class used to sort</p>

<p>Thank you VERY MUCH for your help!</p>
