效果:点击‘添加按钮’,添加两个一对的输入框
html部分代码:
<thead>
<tr>
<th>项目th>
<th>材料名称th>
<th>
<button type="button" class="layui-btn layui-btn-xs layui-btn-primary" style="margin-right: 0;font-size:12px;" id="add_jscs_tr">添加button>
th>
tr>
thead>
<tbody id="jishucanshu_inputs">
{notempty name="$data.jishucanshu"}
{volist name="$data.jishucanshu" id='jscs1'}
<tr class="del operate">
<td><input type="text" name="jscs_one[]" {notempty name="$jscs1[0]"}value="{$jscs1[0]}"{/notempty}>td>
<td><textarea id="symptomTxt" style="height:auto;" style="" name="jscs_two[]">{notempty name="$jscs1[1]"}{$jscs1[1]}{/notempty}textarea>td>
<td>
<button type="button" class="layui-btn layui-btn-xs layui-btn-primary delete" style="margin-right: 0;font-size:12px;">删除button>
td>
tr>
{/volist}
{/notempty}
tbody>
jQuery部分代码:
//技术参数-添加输入框
$('#add_jscs_tr').click(function() {
var html='">" name="jscs_one[]"> '+
'