回答編集履歴
1
文法
test
CHANGED
@@ -1,85 +1 @@
|
|
1
|
-
```javascript
|
2
|
-
|
3
|
-
var table = document.getElementById("table");
|
4
|
-
|
5
|
-
var up = document.getElementById("up");
|
6
|
-
|
7
|
-
var down = document.getElementById("down");
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
var countLimit = 0;
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
if(table){
|
16
|
-
|
17
|
-
table.addEventListener("click", function(){
|
18
|
-
|
19
|
-
if (countLimit < 100) {
|
20
|
-
|
21
|
-
var num = 1;
|
22
|
-
|
23
|
-
for (num; num <= 100; num++) {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
var tr = document.createElement("tr");
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
var td1 = document.createElement("td");
|
32
|
-
|
33
|
-
td1.innerHTML = num;
|
34
|
-
|
35
|
-
tr.appendChild(td1);
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
var td2 = document.createElement("td");
|
40
|
-
|
41
|
-
td2.innerHTML = 'ユーザー名' + num;
|
42
|
-
|
43
|
-
tr.appendChild(td2);
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
var td3 = document.createElement("td");
|
48
|
-
|
49
|
-
td3.innerHTML = 'ログインID' + num;
|
50
|
-
|
51
|
-
tr.appendChild(td3);
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
var td4 = document.createElement("td");
|
56
|
-
|
57
|
-
td4.innerHTML = 'パスワード' + num;
|
58
|
-
|
59
|
-
tr.appendChild(td4);
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
down.appendChild(tr);
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
countLimit++;
|
68
|
-
|
69
|
-
}
|
70
|
-
|
71
|
-
}
|
72
|
-
|
73
|
-
});
|
74
|
-
|
75
|
-
}
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
```
|
82
|
-
|
83
|
-
|
84
|
-
|
85
1
|
countLimitを定義してif文で回数指定しました。
|