For the most part, i got it all done. But when i refresh the page it does not save into the array and i cant find it, how do i make it so its not just a temp array and keep it in the website. Here is my code
const output = document.getElementById("joke")
var jokes = ["test123", "test1235", "testting 1"]
function inputJoke() {
boxvalue = document.getElementById('box').value;
jokes.push(boxvalue);
console.log(jokes);
return false;
}
function randomChoice(){
return jokes[Math.floor(Math.random() * jokes.length)]
}
function jokeText(){
output.innerHTML = `${randomChoice()}`
}
<div class="container">
<h3>Douglas Dad Joke Generator</h3>
<br>
<br>
<button id="jokeBtn" onclick="jokeText()" class="btn">Get Another Joke</button>
<div class="text" id="joke"></div>
<form onsubmit="return inputJoke()">
<input class="submit" placeholder="Dad joke" type="text" id="box">
<input class="submit" type="submit" value="Submit">
</form>
</div>
<script src="script.js"></script>
<link rel="stylesheet" href="style.css">
Here is the website https://dad.sscottdev.com