Question: rite a complete webpage with HTML and JavaScript that displays all prime numbers inclusively between two input positive integers read from the user. For example,
rite a complete webpage with HTML and JavaScript that displays all prime numbers inclusively between two input positive integers read from the user. For example, if two input integers are 3 and 3, the page should display 3. If two input integers are 3 and 7, the page should display 3 5 7. If two input integers are 3 and 12, the page should display 3 5 7 11.
- Define a JavaScript function with logical return type and a single parameter. The function returns true if the parameter is a prime number; otherwise, the function returns false.
- Define another JavaScript function without return and two parameters, both as positive integers. This function displays all prime numbers between two parameters with proper prompt text. This function should call the function defined in Step 1).
- The major script reads two positive integers from the user with proper prompt and then displays them with proper prompt text.
- At the end, the major script calls the function created in Step 2).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
