brooke_theperson Posted April 6, 2015 Share Posted April 6, 2015 (edited) I have this as one of my switch statements as the default: default: document.getElementById("default2").innerHTML = window.alert("I don't know that color."); break; The pop-up box appears and says the message, but when I click "ok" the word "undefined" shows up on the screen. How do I make it so the box pops up, and when you click "ok" nothing shows up on the screen? Edited April 6, 2015 by brooke_theperson Link to comment Share on other sites More sharing options...
davej Posted April 6, 2015 Share Posted April 6, 2015 Ok, that just makes no sense. Try... default: window.alert("I don't know that color."); break; ...or... default: document.getElementById("default2").innerHTML = "I don't know that color"; setTimeout(function(){document.getElementById("default2").innerHTML = "";},5000); break; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now