From 22e698cdadf16941383a7dd44daf4452a58a57cc Mon Sep 17 00:00:00 2001 From: Boof <97455552+hexahigh@users.noreply.github.com> Date: Thu, 11 May 2023 12:18:35 +0200 Subject: [PATCH] made game list sort games alphabetically --- Games/index.html | 4 ++-- Games/index.js | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 Games/index.js diff --git a/Games/index.html b/Games/index.html index bffa28e..d4a261e 100644 --- a/Games/index.html +++ b/Games/index.html @@ -7,11 +7,11 @@ - +

Here you can find a list of games. All games are hosted on this website.

Flash games

Bad website -
+
Terraria Super mario 64 Tic Tac Toe
diff --git a/Games/index.js b/Games/index.js new file mode 100644 index 0000000..d5b8423 --- /dev/null +++ b/Games/index.js @@ -0,0 +1,7 @@ +function sortList(ul) { + var ul = document.getElementById(ul); + + Array.from(ul.getElementsByTagName("A")) + .sort((a, b) => a.textContent.localeCompare(b.textContent)) + .forEach(li => ul.appendChild(li)); + } \ No newline at end of file