|
1. Don't use prompt() as it is intended for debugging only - use a form in your web page instead to collect the values.
2. Don't use document.write - that went out of use when Netscape 4 died as subsequent browsers support the far more powerful innerHTML call instead.
If someone is actually teaching either of those then they need to take a beginners JavaScript class to learn how to write JavaScript for 21st century web browsers.
To be able to advise how to set up a for loop to process the five input fields we will first need to see how you have defined the form. You can convert strings to numbers using either Number(str) or (+str)
You can use Math.max() and Math.min() to get the maximum and minimum values.
|