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.
Example.
<table>
<tr>
<td>data</td> <td>data</td> <td>data</td> <td>info info html <span class="amount">10</span></td>
</tr>
<tr>
<td>data</td> <td>data</td> <td>data</td> <td>info info html <span class="amount">40</span></td>
</tr>
<tr>
<td>data</td> <td>data</td> <td>data</td> <td>info info html <span class="amount">30</span></td>
</tr>
<tr>
<td>data</td> <td>data</td> <td>data</td> <td>info info html <span class="amount">16</span></td>
</tr>
etc
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.
if you would like to see the page in question please use a popular mobile useragent and visit http://mobilereactor.co.uk/shop/mobile-phones/samsung-galaxy-a3-black-deals/ under contracts tab.
jquery
tag ?html
at Question contains one.amount
element . Sort how ? What is expected result ?