Click to See Complete Forum and Search --> : Code


NetSurfer
10-15-2003, 02:18 PM
Hi

I'm a distance education student studying JavaScript. I'm totally new to JavaScript and I have to do the following exercises. Can someone please help me - I can't get it right.
I'm not allowed to use an array for these exercises.


Exercise 4
Write a complete web page that uses a loop to prompt the user for the names of the players in a football team. The page should then display the names in <h1> format, each on a different line in the webpage.

Exercise 5
Write a complete web page that uses a loop to prompt the user for the names of the players in a football team. The page should then display the names, each on a different row in a table in the webpage.

Thanks

Yolandi

sciguyryan
10-15-2003, 02:24 PM
you realise that we should not give you the exact answers but, point you in the right direction - because it is H/W

sciguyryan
10-15-2003, 02:25 PM
why use a loop? you could just assign each prompt to a different variable?

NetSurfer
10-15-2003, 02:40 PM
I know, but the question states that I must use a loop.

sciguyryan
10-16-2003, 09:50 AM
So, in theory you want a loop that returns a different name to a different variable?

NetSurfer
10-16-2003, 02:07 PM
That's right. It's the loop part I'm struggling with. I think there must be 11 variables for the names of each player, but how do you put this into code? By the way we are allowed to get help, they even encourage us to copy code from the internet.

Thanks for the links.

Yolandi

sciguyryan
10-16-2003, 03:01 PM
i think it would have to be a for loop - got any ideas if it is or not? could you post what you have so far?