gpt4 book ai didi

javascript - 在我的例子中,倒数第二个 child 不起作用

转载 作者:行者123 更新时间:2023-11-28 15:16:45 25 4
gpt4 key购买 nike

我有一张 table ,我在下面做了几行,第一个可以,但第二个不行。我想要的是删除最后一个和倒数第二个 td。

$('.table td:last-child').remove()
$('.table td:nth-child(1)').remove()

最佳答案

删除最后一个子级后,倒数第二个成为最后一个子级。就这么写

$('.table td:last-child').remove()
$('.table td:last-child').remove()

关于javascript - 在我的例子中,倒数第二个 child 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33559497/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com