mirror of
https://github.com/hexahigh/games.git
synced 2025-12-11 20:15:38 +01:00
7 lines
226 B
JavaScript
7 lines
226 B
JavaScript
function sortList(ul) {
|
|
var ul = document.getElementById(ul);
|
|
|
|
Array.from(ul.getElementsByTagName("LI"))
|
|
.sort((a, b) => a.textContent.localeCompare(b.textContent))
|
|
.forEach(li => ul.appendChild(li));
|
|
} |