Added "hello" text
This commit is contained in:
@ -10,6 +10,7 @@
|
||||
<header><div>
|
||||
</div></header>
|
||||
<main>
|
||||
<h1 id="helloText"><noscript>Hewwo!</noscript></h1>
|
||||
</main>
|
||||
<footer>
|
||||
<!-- Left side -->
|
||||
|
||||
3
main.js
3
main.js
@ -1,8 +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