I\'ve been playing around trying to get a function that will sort a selection of li tags by their content but currently to no avail (at least no speed/accuracy);
If you want to sort it with javascript, you need a method/function to sort it. And you need to choose when it will be sorted: loading, clicking on a button, etc...
The other possibility is to sort before sending the html: it depends on your server language. Php, java, asp, etc... ? But you can use the same link to find the best algorithm for your needs.