compwebnut777
Baseband Member
- Messages
- 28
Hey guys, having a bit of a problem with some Javascript I wrote for class. When it runs, it fails, as in white screen instead of a prompt box. Anyone know what's going on? I'll put the code in real quick:
What I'm trying to do is get the numbers 2, 5 and 9 to show up on the screen. I'm new to this (hence the probably basic code) and I don't have a clue what is going on, so any help would be greatly appreciated .
Code:
<html>
<head>
</head>
<body>
<script type="text/javascript">
alert("hi");
var birthmonth = parseInt(prompt("Please enter your month of birth",""));
if(birthmonth == 11){
birthmonth = 2;
}
var birthdate = parseInt(prompt("Please enter your date of birth",""));
if(birthdate == 14){
birthdate = 5;
}
var birthyear = parseInt(prompt("Please enter your year of birth",""));
if(birthyear == 1989}{
birthyear = 9;
}
document.write(birthmonth);
document.write(birthdate);
document.write(birthyear);
</script>
</body>
</html>
What I'm trying to do is get the numbers 2, 5 and 9 to show up on the screen. I'm new to this (hence the probably basic code) and I don't have a clue what is going on, so any help would be greatly appreciated .