我可以为表格添加很多行,但我无法删除很多行。我每次只能移除一个连续添加的行。
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script></script>
<table class="form-table" id="customFields">
<tr valign="top">
<th scope="row"><label for="customFieldName">Custom Field</label></th>
<td>
<input type="text" class="code" id="customFieldName" name="customFieldName[]" value="" placeholder="Input Name" />
<input type="text" class="code" id="customFieldValue" name="customFieldValue[]" value="" placeholder="Input Value" />
<a href="javascript:void(0);" id="addCF">Add</a>
</td>
</tr>
</table>
你可以在http://jsfiddle.net/3AJcj/查看代码。我需要帮助。