I have a question in regards to programming in Unit 5 Ch 1 Lesson 6. I have completed coding for level 18 - it works except when Monday is selected. I know it has to do with the onEvent “drop” “change” because Monday is not changed, there is no message selected. This will only happen the first time the program is run; otherwise the program is good. I am providing the code below. Any help would be appreciated.
onEvent(“dropdown1”, “change”, function() {
if (getText(“dropdown1”) == “Saturday”) {
setText(“msg_label”, “It’s the weekend! Stay home!”);
} else if ((getText(“dropdown1”) == “Sunday”)) {
setText(“msg_label”, “It’s the weekend! Stay home!”);
} else {
setText(“msg_label”, “It’s a weekday. Go to school!”);
}
});
//comment Monday doesn’t work because it is not changed need to figure this out