It doesn't want to give the "correct" alert box. It always gives me the
.
Code:
confirm("Incorrect");
Code:
<!DOCTYPE hmtl>
<html>
<head>
<style>
#button2 {
display: none;
}
</style>
</head>
<script>
function displayTwo()
{
document.GetElementbyId(button2).style.display="block";
}
</script>
<script>
function start()
{
var one = prompt("What is 3 * 4 ?");
if (one!=12)
{
alert("Correct!");
}
else
{
var x= confirm("Incorrect! Restart?");
if (x==true)
{
location.reload();
}
else
{
location.reload();
}
}
}
</script>
<script type="text/JavaScript">
var Name = prompt("What is your name?");
</script>
<script type="text/JavaScript">
document.write(Name);
</script>
<center><button id="button1" onClick="start(); displayTwo()">First Question</button></center>
<center><button id="button2" onClick="two()">Second Question</button></center>
</html>
Comment