当我点击添加字符串BTN>我克隆第一TR蒙山输入表并添加在该表中,我需要在占位符复制element.How确定最后的占位符添加+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