日期:2014-05-17  浏览次数:20677 次

动态删除table行(动态添加的文本行)
基本行: <table width="100%" class="tb" id="content">
<tr>
<td width="6%"><input type="hidden" name="id" id="id" /></td>
<td width="10%"><input type="text" name="minact" id="minact"
class="coninput911" parentname="month" />
</td>
<td width="10%"> < 用户数 < </td>
<td width="10%"><input type="text" name="maxact" id="maxact"
class="coninput911" parentname="month" />
</td>
<td width="10%">基本费用</td>
<td width="10%"><input type="text" name="basefees"
id="basefees" class="coninput911" parentname="month" />
</td>
<td width="7%">元/月</td>
<td width="10%"><input type="text" name="singlefees"
id="singlefees" class="coninput911" parentname="month" />
</td>
<td width="10%">元/月,终端</td>
<td width="10%"><input type="text" name="zhekou"
id="zhekou" class="coninput911" parentname="month" />
</td>
<td width="7%">%折扣 <input type="hidden" name="feesid"> </td>
</tr>
</table>










要复制的行



<table class="tb1">
<tr>
<td width="6%">
<p id="remove" onclick="removeadd()">移除</p> 
<input type="hidden" name="id" id="id" />
</td>
<td width="10%"><input type="text" name="minact" id="minact"
class="coninput911" parentname="month" /></td>
<td width="10%"> < 用户数 < </td>
<td width="10%"><input type="text" name="maxact" id="maxact"
class="coninput911" parentname="month" /></td>
<td width="10%">基本费用:</td>
<td width="10%"><input type="text" name="basefees"
id="basefees" class="coninput911" parentname="month" /></td>
<td width="7%">元/月,</td>
<td width="10%"><input type="text" name="singlefees"
id="singlefees" class="coninput911" parentname="month" /></td>
<td width="10%">元/月,终端</td>
<td width="10%"><input type="text" name="zhekou"
id="zhekou" class="coninput911" parentname="month" /></td>
<td width="7%">%折扣</td>
</tr>
</table>

我的添加方法:$("#btnadd").bind('click', function() {
var tr = $(".tb1 tr").eq(0).clone(true);
// tr.find("td").get(0).innerHTML = ++i;
tr.show();
tr.appendTo($(".tb"));
});
});