Uncategorized
write a javascript for below questions.
Learning Goal: I’m working on a javascript practice test / quiz and need an explanation and answer to help me learn.
- 1. Display numbers
- Write a JavaScript that prints all the numbers from 1 to 20 on a page when it loads.
- Use a loop, do not just write the numbers
- 2.Prompt for name
- Write a script that asks the user for their name (use prompt)
- Then display the name in a confirm box and ask if correct
- If it is correct, display a message on the page that says “Welcome “ followed by the name.
- If it is not correct, loop through and ask for input again
- 3.Enter your grade
- Ask the user for a number between 1-100
- If the user enters 90-100 display A
- If the user enters 80-89 display B
- If the user enters 70-79 display C
- If the user enters 60-69 display D
- If the user enters below 60 display F