$(document).ready(function(){
$("#addrow").click(function(){
var div = $("#root:first").clone();
$(".mt-repeater").append(div);
});
});
function delrow(obj) {
var parent_id = $(obj).parent().parent();
var count = $(".mt-repeater").find($(".mt-overflow")).length;
if (count<2) {
return false;
}
$(parent_id).remove();
}
<div class="form-group col-md-4 mt-repeater">
<div class="mt-repeater-item mt-overflow" id="root">
<div class="mt-repeater-cell">
<input type="text" placeholder="<?=lang('输入域名')?>" class="form-control mt-repeater-input-inline" name="domain[]" />
<a class="btn btn-danger mt-repeater-delete mt-repeater-del-right mt-repeater-btn-inline" id="delrow" onclick="delrow(this);">
<i class="fa fa-close"></i>
</a>
</div>
</div>
</div>
<a class="btn btn-success" id="addrow">
<i class="fa fa-plus"></i> <?=lang('新增一条')?></a>
上一篇: 阿里云服务器ECS被肉鸡如何解决?
下一篇: Centos安装dos2unix
售后保障
承诺任何问题1小时内解决数据备份
更安全、更高效、更稳定价格公道精准
项目经理精准报价不弄虚作假合作无风险
重合同讲信誉,无效全额退款