Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the file first_loop.htm so that there is a second text field asking the user how many times they want to be greeted, stipulating that

Modify the file first_loop.htm so that there is a second text field asking the user how many times they want to be greeted, stipulating that it must be between 1 and 20. Then greet them that many times.

Validation: Confirm that value was indeed between 1 and 20. If it is not, output a message reminding them that they must enter a value between 1 and 20, and then do not continue with the function (make the function end). Hint: Remember that a 'return' staement will a function.

If the user enters invalid input, then output the appropriate message (e.g. "You must enter a number between 1 and 20") to a div section called 'errors'. Also set the background color of the invalid text field to yellow.

Note: Each time the user clicks the button, you should remove any output from a previous run of the program. If any errors are present, you should remove any error messages, and remove the yellow background from the text field (by setting the background color to white).

First Loop

Type in your name and I will greet you 3 times!


Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions