Good evening everyone,
I am practicing, well doing things the wrong way mostly.
I have a very simple script that generates a prompt window.
Instead of using a default text, I have left the text field empty.
However, I would like a default message to display in the pop up window if the user does not enter a value in the prompt box before clicking okay.
I tried adding a conditional statement but the default text does not write in the pop up window.
Here is the code:
var message = prompt("Who is your favorite Hollywood Star?", "");
newWindow = window.open('','','width=800,height=600');
if ((prompt) == null);
document.write("No Value Entered");
I'll do more reading when I get home.