ASDV-WebDev/Semester 1/Chapter ZIPs/JavaScript/ch8/ex_8_6.html

20 lines
395 B
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Example 8.6</title>
<script type="text/javascript">
var names = new Array();
var numStud = prompt("How many students are in the class: ");
numStud = parseInt(numStud);
var i = 0;
for (i = 0; i <= numStud - 1; i++)
{
names[i]= prompt("Enter the student's name: ");
}
</script>
</head>
<body>
</body>
</html>