mirror of
https://github.com/hexahigh/games.git
synced 2025-12-11 20:15:38 +01:00
made game list sort games alphabetically
This commit is contained in:
parent
3c7687b948
commit
22e698cdad
@ -7,11 +7,11 @@
|
||||
<link rel="stylesheet" href="/style.css" Type="text/css" media="all">
|
||||
<script src="index.js"></script>
|
||||
</HEAD>
|
||||
<BODY class="animated-gradient">
|
||||
<BODY onload="sortList('GameList')" class="animated-gradient">
|
||||
<p>Here you can find a list of games. All games are hosted on this website.</p>
|
||||
<h1><p><a style="font-size:2vw" href="/Games/Flash/">Flash games</a></p></h1>
|
||||
<title>Bad website</title>
|
||||
<div class="donationcompact">
|
||||
<div class="donationcompact" id="GameList">
|
||||
<a href="/Games/Terraria 1.0/">Terraria</a>
|
||||
<a href="sm64/">Super mario 64</a>
|
||||
<a href="/Games/Tic Tac Toe/">Tic Tac Toe</a><br>
|
||||
|
||||
7
Games/index.js
Normal file
7
Games/index.js
Normal file
@ -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));
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user