samedi 1 mai 2021

my If Else ladder is not working !!! it is only recognising 1st if then it is not working [duplicate]

this is my code!!.

document.getElementById('submit').addEventListener('click' , function(){

var answer = document.getElementById('answer').value;

if (answer === 'your portfolio ', 'portfolio'  , 'I want to see your portfolio') {
    window.location = 'http://upedge.000webhostapp.com/';
}

else if (answer === 'your first website' , 'first website' ,'i want to see your first website' ,'first' , 'website'){
    window.location = 'http://upedge.000webhostapp.com/';
} 

else if (answer === 'insta' , 'instagram' , 'insta account') {
    window.location = 'https://www.instagram.com/talwar_om/';
}
else{
    console.log('try Again');
};

});

Aucun commentaire:

Enregistrer un commentaire