In JavaScript , the correct syntax for elseif is "else if" not "elseif". else if statement is used where we have to check multiple statement.
Example :
var eating;
if(eating < 8){
document.write("Time to take brunch");
}
else if(greering < 11){
document.write(" Time to take lunch");
else if(eating < 14){
document.write("Time to take Lunch");
}
else
{
document.write("Time to take dinner");
}
1 Comment(s)