javascript で毎週のイベントマネージャーを作成しました。しかし、何かがうまくいかなかった。コードが機能していません。誰かが障害を解決してください。何が問題なのですか?????
var plan=prompt("Hello , Made a week plan. Type the week name to add a event");
var week = ["saturday" , "sunday" , "monday" , "tuesday"];
var saturday;
var sunday;
var monday;
var tuesday;
if( plan == "saturday" ) {
var saturday=prompt("What will you do in saturday?");
} else if ( plan == "sunday") {
var sunday=prompt("What will you do in sunday?");
} else if (plan == "monday") {
var monday=prompt("var getknow=prompt(""What will you do in monday?");
} else if (plan == "tuesday" ) {
var tuesday=prompt("What will you do in tuesday?");
}
var getknow=prompt("Do you want to cheack the schedule? Type the week name");
if ( getknow == saturday) {
alert(saturday);
} else if (getknow == sunday ) {
alert(sunday);
} else if (getknow == monday) {
alert(monday);
} else if (getknow == tuesday) {
alert(tuesday);
}
これらのコード行がなくても、すべてが機能しています
var getknow=prompt("Do you want to cheack the schedule? Type the week name");
if ( getknow == saturday) {
alert(saturday);
} else if ( getknow == sunday ) {
alert(sunday);
} else if ( getknow == monday ) {
alert(monday);
} else if ( getknow == tuesday ) {
alert(tuesday);
}