私は、文字列を追加するをクリックします。btn>私はテーブルの最初のtr whith入力を複製し、このテーブルを追加します。そして、プレースホルダーコピーされた要素に+1番号を追加する必要があります。/ このHTMLテーブルのコピーの前にして、新しいコピープレースホルダに追加プレースホルダ逐次加算数の追加方法は?
<div class="matrix_a_cover">
<table class="matrix_a brackets" id="matrix_a">
<tr>
<td class="str_inp">
<input type="text" placeholder="a1,1">
</td>
<td class="str_inp">
<input type="text" placeholder="a1,2">
</td>
</tr>
<tr>
<td class="str_inp">
<input type="text" placeholder="a2,1">
</td>
<td class="str_inp">
<input type="text" placeholder="a2,2">
</td>
</tr>
<tr>
<td class="str_inp">
<input type="text" placeholder="a3,1">
</td>
<td class="str_inp">
<input type="text" placeholder="a3,2">
</td>
</tr>
<tr>
<td class="str_inp">
<input type="text" placeholder="a4,1">
</td>
<td class="str_inp">
<input type="text" placeholder="a4,2">
</td>
</tr>
</table>
</div>
このコードのコピー要素
$('.add_str').click(function(){
if ($("#check_mtrx_a").prop("checked")){
$('.matrix_a tr:first').clone().appendTo('.matrix_a');
}else if($("#check_mtrx_b").prop("checked")) {
$('.matrix_b tr:first').clone().appendTo('.matrix_b');
}
});
と、このすべてのリンクserjo96.github.io/matrix
から始まります。問題は何ですか? – Justinas