//Create constants to store elements for button and text field
const signButton = document.querySelector("#signButton");
const log = document.querySelector("#log");
signButton.addEventListener("click", () => {
//show input prompt on screen when button is clicked
let sign = prompt("What's your sign?");
if (sign === null) {
//if cancel is clicked within the prompt, sign returns as null
log.innerText = "OK, maybe next time.";
}
else if (sign.toLowerCase() === "") {
//if ok is clicked within the prompt, a blank string returns
log.innerText = "Don't be shy, enter your sign!";
}
else if (sign.toLowerCase() === "scorpio") {
//if this exact string is entered
log.innerText = "Wow! I'm a Scorpio too!";
}
else {
//covers all other strings
log.innerText = `${sign} is my favorite!`;
}
});