teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

足りないコードの追加

2016/12/26 03:54

投稿

ghu_ggu
ghu_ggu

スコア8

title CHANGED
File without changes
body CHANGED
@@ -7,6 +7,25 @@
7
7
 
8
8
  ###該当のソースコード
9
9
  ```html
10
+ <form class="gear">
11
+ <span>攻撃ギアが
12
+ <select id="attackmain">
13
+ <option value="0">0</option>
14
+ </select>
15
+ .
16
+ <select id="attacksub">
17
+ <option value="0">0</option>
18
+ </select></span>
19
+ <span>防御ギアが
20
+ <select id="deffencemain">
21
+ <option value="0">0</option>
22
+ </select>
23
+ .
24
+ <select id="deffencesub">
25
+ <option value="0">0</option>
26
+ </select>
27
+ <button type='submit' id='confirm'>確定</button></span>
28
+ </form>
10
29
  <table align="left">
11
30
  <tbody class="result">
12
31
  <tr align="left">
@@ -20,6 +39,17 @@
20
39
  ```
21
40
 
22
41
  ```javascript
42
+ $(function count1() {
43
+ for (var i = 1; i <= 3; i++) {
44
+ $('#attackmain,#deffencemain').append($('<option />').val(i).html(i));
45
+ }
46
+ });
47
+
48
+ $(function count2() {
49
+ for (var i = 1; i <= 9; i++) {
50
+ $('#attacksub,#deffencesub').append($('<option />').val(i).html(i));
51
+ }
52
+ });
23
53
  $(function() {
24
54
  //tableを作成
25
55
  var weapon = ['わかばシューター', 'スプラシューター', "プライムシューター", ".52ガロン", ".96ガロン", "N-ZAP", "シャープマーカー", "ボールドマーカー", "L3リールガン", "H3リールガン", "デュアルスイーパー", 'スプラスピナー', "バレルスピナー", ];