片段之一删除表行:通过选择表行的单元格
$(document).ready(function() {
$('button').click(function() {
$('table').append("<tr><td id='no'>X</td><td>Example</td></tr>")
});
$('th').on('click', '#no', function() {
$(this).remove();
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
<tr>
<th>Delete</th>
<th> Element</th>
</tr>
<tr>
<td id='no'>X</td>
<td>Example</td>
</tr>
</table>
<br>
<button>
More
</button>
我想,当我点击该行的X要删除的行。我应该添加哪些代码来执行此操作?
[删除表的可能的复制行后单击表格行删除按钮](https://stackoverflow.com/questions/11553768/remove-table-row-after-clicking-table-row-delete-button) – Sand