To start, open this template:
And then "Fork" it
(makes a copy)
Don't sign up if you're under 13
Just "Save as Anonymous"
function go() {
alert("hi");
}
<div>
<form>
What is your burning question?<br><br>
<input type="text" id="question"><br><br>
<button onclick="go()">
Reveal your destiny
</button>
</form>
</div>
Changes are saved to your personal URL. Paste it somewhere so you can get to it later!
function go() {
alert("hi");
}
const fortunes = ["No", "Definitely",
"Maybe", "Definitely maybe",
"Stop trying to predict the future"]
function go() {
alert("hi");
}
const fortunes = ["No", "Definitely",
"Maybe", "Definitely maybe",
"Stop trying to predict the future"]
function pickRandom(fortunes) {
return fortunes[Math.floor(Math.random()*fortunes.length)];
}
function go() {
alert(pickRandom(fortunes));
}
const fortunes = ["No", "Definitely",
"Maybe", "Definitely maybe",
"Stop trying to predict the future"]
function pickRandom(fortunes) {
return fortunes[Math.floor(Math.random()*fortunes.length)];
}
function go() {
// get what's currently in the text input
var input = document.getElementById("question").value;
// if the # of letters in the input is greater than 0
if (input.length > 0) {
alert(pickRandom(fortunes));
}
// otherwise, do this
else {
alert("Ask a question to get an answer.");
}
}