If / Else Help!
So I have been modifying a javascript that I made a while ago, and currently I have been attempting to fix a part of the script by adding an "else" statement at the end of it in order to execute a certain command if the response given is not "good" or "bad". When I try to load this script, nothing happens, therefore I must be doing something wrong. Can anyone tell me why this script isn't working? Script: var name = prompt("What is your name?"); var response = prompt("Nice to meet you, " + name + ". Are you feeling good or bad today?"); if (response == "good") { document.write("You're doing well " + name + ", that's great to know! Goodbye!"); } else if (response == "bad") { document.write("I see, " + name + ". "); var scale = prompt("Aw, that's too bad! On a scale of 1 through 10, how bad do you think youre feeling?"); if (scale == "1") { document.write(" Only 1? That shouldn't be that bad!") } else if (scale == "2") { document.write(" Hey, 2 isn't the worst! Cheer up!"); } else if (scale == "3") { document.write(" Hey, at least it isn't 4!"); } else if (scale == "4") { document.write(" 4? Cheer up!"); } else if (scale == "5") { document.write(" 5? Meh."); } else if (scale == "6") { document.write(" Well, at least it isn't 7!"); } else if (scale == "7") { document.write(" Hey! 7 is my favorite number!"); } else if (scale == "8") { document.write(" 8 is less than 9, right? Cheer up!"); } else if (scale == "9") { document.write(" Hey, at least 9 isn't a double digit!"); } else if (scale == "10") { document.write(" Well arent you negative! Go find something to cheer yourself up!"); } else { document.write(" Hey, I said 1-10! My processor isn't intelligent enough for those types of numbers!"); } else { document.write("You're doing " + response + "? I'm sorry, but I don't understand that statement."); } When I added the else part at the end, the script stopped working.