質問編集履歴

1

コードの追加

2017/05/10 01:31

投稿

hide09090909
hide09090909

スコア68

test CHANGED
File without changes
test CHANGED
@@ -72,6 +72,76 @@
72
72
 
73
73
 
74
74
 
75
+ jspファイルをChromeで実行した際のソースは以下の通りです。
76
+
77
+ ```ここに言語を入力
78
+
79
+ <html>
80
+
81
+ <head>
82
+
83
+ <meta charset="utf-8">
84
+
85
+ <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
86
+
87
+ <script>
88
+
89
+ $(function(){
90
+
91
+ $('#add').on("click", function() {
92
+
93
+ var tr = '<tr><td><input type="checkbox" name="checkbox" value="' + "val" + '"></td><td>' + "val" + '</td><td>' + "resuto21" + '</td><td>' + "tesuto3" + '</td><td>' + "tesuto4" + '</td><td>' + "tesuto5" + '</td><td>' + "val" + '</td></tr>';
94
+
95
+ $('#sample_table').append(tr);
96
+
97
+ });
98
+
99
+
100
+
101
+ $('#del').on("click", function() {
102
+
103
+ $('#sample_table input[type=checkbox]:checked').each(function() {
104
+
105
+ $(this).closest('tr').remove();
106
+
107
+ });
108
+
109
+ });
110
+
111
+ });
112
+
113
+ </script>
114
+
115
+ </head>
116
+
117
+ <body>
118
+
119
+
120
+
121
+ <table id="sample_table" class="demo">
122
+
123
+ <tr><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th><th>6</th><th>7</th></tr>
124
+
125
+ </table>
126
+
127
+
128
+
129
+ <button type="button" id="add" name="sampleadd" class="btn margin-bottom" style="color: #ffffff; background-color: #40b740;">追加</button>
130
+
131
+ <button type="button" id="del" name="sampledel" class="btn margin-bottom" style="color: #ffffff; background-color: #40b740;">削除</button>
132
+
133
+
134
+
135
+ </body>
136
+
137
+ </html>
138
+
139
+
140
+
141
+ ```
142
+
143
+
144
+
75
145
  何が原因で、動作が異なるのか理解できず、修正が行えません。
76
146
 
77
147
  どなたか、分かる方、問題点/修正方法を教えてください。