Needing help with the following script. I am tasked to return the name.length individually for names entered in the prompt as well as change from lower case to upper case. With the current script it returns a list of names in the number of names not the individual length of each name nor can I get document.write(word.toUpperCase(); to work. Script below:


<html>
<head>
</head>
<body>
<p>Enter 20 names</p>
<script>
names = new Array();
i = 0;
do {
next = window.prompt("Enter the Next Name", "");
if (next > " ") names[i] = next;
i = i + 1;
}
while (next > " ");
document.write("<h2>" + (names.length) + " names entered.</h2>");
document.write("<ol>");
for (i in names) {
document.write("<li>" + names[i] + "<br>");
}
document.write("</ol>");
</script>
</body>
</html>