-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson6.html
executable file
·39 lines (36 loc) · 925 Bytes
/
lesson6.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
31
32
33
34
35
36
37
38
39
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Function</title>
<script type="text/javascript">
var flag = false;
var j = 32;
function startloop(startvalue) {
flag = false;
var temp = "";
for (var i=startvalue; i<=j; i++) { //9
temp = temp + String.fromCharCode(i) + " ";
}
document.getElementById("loop").innerHTML = temp;
j=j+1; //j++
}
function finishloop(endvalue) {
if (flag == true)
return false;
var temp = "";
for (var i=j; i<=endvalue; i++) { //9
temp = temp + String.fromCharCode(i) + " ";
}
var inner = document.getElementById("loop").innerHTML;
inner = inner + temp;
document.getElementById("loop").innerHTML = inner;
flag = true;
}
</script>
</head>
<body>
<input type="button" value="Write Loop" onclick="startloop(31);" />
<input type="button" value="Finish Loop" onclick="finishloop(126);" />
<div id="loop" name="loop"></div>
</body>
</html>