mercredi 5 avril 2017

Trying the else if statement?

Hi im a noob im having a problem figuring out how to use the else if

heres what i got so far it dosent work right for me..

    var name = "mom"
var name = "dad"
name = prompt("what is your name?");
if (name = "mom"){ 
     alert("Hello Mother." );
} if (name = "dad"){
     alert("hello father." );
}

Aucun commentaire:

Enregistrer un commentaire