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);
var sortList = function () {
var ul = document.getElementsByTagName("ul"),
ol = document.getElementsByTagName("ol"),
sort = function (x) {
var a, li;
for (a = 0; a < x.length; a += 1) {
li = x[a].getElementsByTagName("li");
li = li.sort();
x[a].innerHTML = li.join("");
}
};
sort(ul);
sort(ol);
};