container
是我的主要部分,process
紧随其后。 process
由许多 parent_node
组成,每个 parent_node
都有不同的子节点(但是都有 h3
)。
我想从不是祖 parent 的前两个 child 的 parent 那里选择不是 h3 的 child 节点。
我尝试过的:
$(('.container > .process > .parent_node.slice(2) > :not(h3)')
如何更正上述内容?
最佳答案
我相信一个简单的 nth-child
应该可以解决问题:
.container > .process > .parent_node:nth-child(n + 3) > :not(h3)
关于jquery - 从不是jQuery中祖 parent 的前两个 child 的 parent 中选择不是h3的 child 节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54230271/