This commit is contained in:
GordonDaFreeman 2018-01-17 14:57:04 +01:00
parent 399c6749c8
commit 3c5f2279a9
1 changed files with 0 additions and 30 deletions

View File

@ -264,33 +264,3 @@ function updateoutput() {
}
})
}
function sortUnorderedList(ul, sortDescending) {
if (typeof ul == "string")
ul = document.getElementById(ul);
// Idiot-proof, remove if you want
if (!ul) {
alert("The UL object is null!");
return;
}
// Get the list items and setup an array for sorting
var lis = ul.getElementsByTagName("LI");
var vals = [];
// Populate the array
for (var i = 0, l = lis.length; i < l; i++)
vals.push(lis[i].innerHTML);
// Sort it
vals.sort();
// Sometimes you gotta DESC
if (sortDescending)
vals.reverse();
// Change the list on the page
for (var i = 0, l = lis.length; i < l; i++)
lis[i].innerHTML = vals[i];
}