-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchapter_15_16_17.html
30 lines (28 loc) · 1.16 KB
/
chapter_15_16_17.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<html>
<head>
<title>Chap 9</title>
</head>
<body>
</body>
<script>
var courses=[];
var course1 =prompt("course 1", "computer")
var course2 =prompt("course 2", "computer")
var course3 =prompt("course 3", "computer")
var course4 =prompt("course 4", "computer")
var course5 =prompt("course 5", "computer")
courses.push(course1,course2,course3,course4,course5);
alert(courses)
course1=prompt("Edit course1", courses[0])
var cou1 = courses.splice(0,1,course1);
course2=prompt("Edit course2", courses[1])
var cou2 = courses.splice(1,1,course2);
course3=prompt("Edit course3", courses[2])
var cou3 = courses.splice(2,1,course3);
course4=prompt("Edit course4", courses[3])
var cou4 = courses.splice(3,1,course4);
course5=prompt("Edit course5", courses[4])
var cou5 = courses.splice(4,1,course5);
alert(courses);
</script>
</html>