I have a HTML table like this:
DE 11条回答 一向 (楼主) 2020-12-13 08:08 A generic way (not tested): $("a.delete").click(function() { var colnum = $(this).closest("td").prevAll("td").length; $(this).closest("table").find("tr").find("td:eq(" + colnum + ")").remove(); } No need to change markup. 0 讨论(0) 查看其它11个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
A generic way (not tested):
$("a.delete").click(function() { var colnum = $(this).closest("td").prevAll("td").length; $(this).closest("table").find("tr").find("td:eq(" + colnum + ")").remove(); }
No need to change markup.