Reorder list elements (by code, not mouse)
I have a list with values and the order from start is a bit random and differs from time to time:
- <ul>
- <li>2</li>
- <li>10</li>
- <li>5</li>
- <li>7</li>
- <li>6</li>
- <li>8</li>
- <li>9</li>
- <li>4</li>
- <li>1</li>
- <li>3</li>
- </ul>
How do I reorder the list so that 1, 3, 6 and 7 always ends up first?
Also the order of the rest of the elements needs to be preserved. So the result would be:
- <ul>
- <li>1</li>
- <li>3</li>
- <li>6</li>
- <li>7</li>
- <li>2</li>
- <li>10</li>
- <li>5</li>
- <li>8</li>
- <li>9</li>
- <li>4</li>
- </ul>