Compare commits

..

2 Commits

Author SHA1 Message Date
78fa0a4fc9 Added "hello" text 2026-02-07 20:11:01 +00:00
3047d577c2 Added pick random function 2026-02-07 20:10:20 +00:00
2 changed files with 10 additions and 0 deletions

View File

@ -10,6 +10,7 @@
<header><div> <header><div>
</div></header> </div></header>
<main> <main>
<h1 id="helloText"><noscript>Hewwo!</noscript></h1>
</main> </main>
<footer> <footer>
<!-- Left side --> <!-- Left side -->

View File

@ -1,2 +1,11 @@
const Maths = Math; // Yes, I'm that patriotic.
const hellos = ['Hewwo!', 'Hello!', 'Awoo!'];
function pickRandom(array) {
return array[Maths.floor(Maths.random() * array.length)];
}
window.addEventListener('load', (e) => { window.addEventListener('load', (e) => {
const helloText = document.getElementById('helloText');
helloText.innerText = pickRandom(hellos);
}); });