Sort Table rows by .class on page load jQuery/Javascript
<p>I have a table cell within my HTML table which contains information - amongst that information is a price (class .amount). I want to sort the table rows by that class using jQuery when the page loads. </p>

<p>Example.</p>

<pre><code>&lt;table&gt;
&lt;tr&gt;
    &lt;td&gt;data&lt;/td&gt; &lt;td&gt;data&lt;/td&gt; &lt;td&gt;data&lt;/td&gt; &lt;td&gt;info info html &lt;span class="amount"&gt;10&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;data&lt;/td&gt; &lt;td&gt;data&lt;/td&gt; &lt;td&gt;data&lt;/td&gt; &lt;td&gt;info info html &lt;span class="amount"&gt;40&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;data&lt;/td&gt; &lt;td&gt;data&lt;/td&gt; &lt;td&gt;data&lt;/td&gt; &lt;td&gt;info info html &lt;span class="amount"&gt;30&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
    &lt;td&gt;data&lt;/td&gt; &lt;td&gt;data&lt;/td&gt; &lt;td&gt;data&lt;/td&gt; &lt;td&gt;info info html &lt;span class="amount"&gt;16&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;

etc
</code></pre>

<p>I do not require client side table sorting. I just want the table to be pre-arranged for the user so I would like not to use a library.</p>

<p>if you would like to see the page in question please use a popular mobile useragent and visit <a href="http://mobilereactor.co.uk/shop/mobile-phones/samsung-galaxy-a3-black-deals/" rel="nofollow">http://mobilereactor.co.uk/shop/mobile-phones/samsung-galaxy-a3-black-deals/</a> under contracts tab.</p>