Searching for a solution to my problem, I have found many fixes for something similar, but not identical. However, since I would categorize myself as a javascript beginner, I can't figure out how to use those fixes for my own solution. Hence, I am asking you.
I am working on a chat. On one page there is a list of conversations. Each conversation look like this: <li id="+conversationID+" class=\"people-item\"><a href=\"#\" id="+obj.newest_message_time+" class=\"list-group-item\"><span class="+conversationID+"><p class=\"participants\">" + participantsStringified + "</p><p class=\"new_message\">Me: "+obj.newest_message+"</p></span></a></li>;
As you can see, the <a>
inside <li>
has an ID of obj.newest_message_time
, which is a number that is programmatically added when the conversations is created.
So imaginging there are multiple <li>
's, how can I sort them by using the id?