Compare commits
2 Commits
683c931e9c
...
78fa0a4fc9
| Author | SHA1 | Date | |
|---|---|---|---|
|
78fa0a4fc9
|
|||
|
3047d577c2
|
@ -10,6 +10,7 @@
|
||||
<header><div>
|
||||
</div></header>
|
||||
<main>
|
||||
<h1 id="helloText"><noscript>Hewwo!</noscript></h1>
|
||||
</main>
|
||||
<footer>
|
||||
<!-- Left side -->
|
||||
|
||||
9
main.js
9
main.js
@ -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) => {
|
||||
const helloText = document.getElementById('helloText');
|
||||
helloText.innerText = pickRandom(hellos);
|
||||
});
|
||||
Reference in New Issue
Block a user