A coworker and I are worker on a game regarding poverty, we need help with else if statements as nothing is working, this is what we have.
<!DOCTYPE html>
<html>
<body>
<p>Click to play please!</p>
<button onclick=”FunctionGameIntro()”>Play</button>
<p id=”demo”></p>
<script>
function FunctionGameIntro() {
window.alert(“Welcome to the game.”);
var player1 = prompt(“Please enter your name.”, “”);
if (player1 != null) {
document.getElementById(“demo”).innerHTML =
“Hello ” + player1 + “! How are you today?”;
var money = 1500;
var money2 = 1300;
window.alert(“Your current balance is”);
window.alert(money);
window.alert(“Hello, today you will learn what it is like to be a person living with minimum wage!”)
var job=window.prompt(“Please enter Bellhop, McDonalds Cook, or Janitor.”);
window.alert(“Your current job is ” + job);
window.alert(“You need to buy a uniform, your balance is now “);
window.alert(money – 200);
window.alert(“You need to choose a healthcare plan.”);
var HealthCare=window.prompt(“Choose Bronze, Silver, Gold, or Platinum”);
if (HealthCare=”Bronze”)
{
window.alert(“You have chosen the bronze plan.”);
window.alert(“Your current balance is “);
window.alert(money2 – 100);
}
else if (HealthCare=”Silver”)
{
window.alert(“You have chosen the silver plan.”);
window.alert(“Your current balance is “);
window.alert(money2 – 200);
}
else if (HealthCare=”Gold”)
{
window.alert(“You have chosen the golden plan.”);
window.alert(“Your current balance is “);
window.alert(money2 – 300);
}
else if(HealthCare=”Platinum”)
{
window.alert(“You have chosen the platinum plan.”);
window.alert(“Your current balance is “);
window.alert(money2 – 400);
}
}
}
</script>
</body>
</html>