tnbrwneyez
Programmer
I need to loop the names entered and have them to list alphabetically and I cannot figure out how. Can anyone helo me? Here is my script:
<html>
<head>
<title>Loops Example</title>
</head>
<body>
<h1>Loop Example</h1>
<Script LANGUAGE="JavaScript1.2" type="text/javascript1.2">
names = new Array();
i=0;
do {
next=window.prompt("Enter the Next Name", "");
if (next > "") names =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 + "<br>");
}
document.write("</ol>");
</script>
</body>
</html>
I would appreciate any help that I can get.
Thanks
<html>
<head>
<title>Loops Example</title>
</head>
<body>
<h1>Loop Example</h1>
<Script LANGUAGE="JavaScript1.2" type="text/javascript1.2">
names = new Array();
i=0;
do {
next=window.prompt("Enter the Next Name", "");
if (next > "") names =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 + "<br>");
}
document.write("</ol>");
</script>
</body>
</html>
I would appreciate any help that I can get.
Thanks