tnbrwneyez
Programmer
I have a script that I need to have code set to only allow 10 names. What do I need to add to this 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>");
names.sort();
for (i in names){
document.write("<li>" + names + "<br>");
}
document.write("</ol>");
</script>
</body>
</html>
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>");
names.sort();
for (i in names){
document.write("<li>" + names + "<br>");
}
document.write("</ol>");
</script>
</body>
</html>
Thanks!!