I have a page with a 'ul' (unordered list) that I insert 'li' elements on the fly. With 2 attributes: data-col and data-row. This two attributes are arbitrary and can be any value. (any Real positive number)
Is there a way to re-order all 'li' elements based on data-row and data-col? It does not have to be visible, I just need the 'ul' element with all its children properly ordered.
Extra info: The reason for this is because I have a back-end code that needs to read this 'ul' element with its children in sequence and then populate a TABLE element. It´s like I´m saving a multi-dimensional array into a 1 dimension array.
Thanks :)