回答編集履歴

1

修正

2017/04/17 06:15

投稿

yambejp
yambejp

スコア114784

test CHANGED
@@ -75,3 +75,85 @@
75
75
  </div>
76
76
 
77
77
  ```
78
+
79
+
80
+
81
+ # 修正
82
+
83
+ 最初不活性で増えると活性化するんでした、以下修正しておきます
84
+
85
+ ```javascript
86
+
87
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
88
+
89
+ <script>
90
+
91
+ $(function(){
92
+
93
+ $('[name=filecomparison_result]').prop("disabled",true);
94
+
95
+ $('[name=add]').on('click',function(){
96
+
97
+ $('#testo').append($('<tr>')
98
+
99
+ .append($('<td>').text("test"))
100
+
101
+ .append($('<td>').text("test"))
102
+
103
+ .append($('<td>').text("test"))
104
+
105
+ .append($('<td>').text("test"))
106
+
107
+ .append($('<td>').text("test"))
108
+
109
+ .append($('<td>').text("test")));
110
+
111
+ $('[name=filecomparison_result]').prop("disabled",$('#result tr').length<2);
112
+
113
+ });
114
+
115
+ });
116
+
117
+ </script>
118
+
119
+ <table class="sample" id="testo">
120
+
121
+ <thead>
122
+
123
+ <tr>
124
+
125
+ <th></th>
126
+
127
+ <th>a</th>
128
+
129
+ <th>b</th>
130
+
131
+ <th>c</th>
132
+
133
+ <th>d</th>
134
+
135
+ <th>e</th>
136
+
137
+ </thead>
138
+
139
+ <tbody id="result">
140
+
141
+ </tbody>
142
+
143
+ </table>
144
+
145
+
146
+
147
+ <div class="row">
148
+
149
+ <div class="col-xs-12">
150
+
151
+ <button type="button" id="add" name="add" class="btn margin-bottom" style="color: #ffffff; background-color: #40b740;">追加</button>
152
+
153
+ <input type="button" name="filecomparison_result" value="test">
154
+
155
+ </div>
156
+
157
+ </div>
158
+
159
+ ```