I am facing a minor issue with my JavaScript code. I am in the initial stages of learning JavaScript and currently experimenting with else if statements along with the 'prompt' action. However, for some reason, this action is not getting executed, causing me to be unable to assign a value to the 'Chicken' variable.
Can anyone point out what mistake I might have made?
<html>
<head></head>
<body>
<script>
function checkState(){
var chicken = prompt("Enter a value");
var alive = 1;
var dead = 2;
if (chicken == alive) {
document.write("Chicken is Alive");
}
else if(){
document.write("Chicken is Dead");
}
}
</script>
</body>
</html>