This is what I'm trying to figure out. User inputs as many names as they want in a prompt until they input nothing. The names are stored in an array and displayed.
ok, so I know how to display the stored names if I know how many prompts there are going to be, like this:
var name= new Array(5);
for (y=0; y<5; y++)
name[y]=prompt('Enter a name!',' ');
for (x=0; x<5; x++)
document.write(name[x] + "<br>");
And I know how to keep asking for prompt until the user enters nothing, like this:
name = prompt("Enter some names");
while (name != ' ');
Thats the problem, I can't figure out how to prompt and store since I have no idea how many prompts there will be and I dont know if I can combine these 2 codes or some other way to do it.
Any help is apreciated.