I have a table that looks something like this:
<table> <tr id="1"> <td>bla</td> </tr> <tr id="2"> <td>bla</td> </tr> <tr id="3"> <td>bla</td> </tr> <tr id="4"> <td>bla</td> </tr> </table>
I also have an array according to which I have to sort the rows of this table, for example, the array looks something like this:
array = [3, 4, 1, 2];
Any hints or ideas, how can I reorder the lines with jquery / javascript to fit an array?
source share