Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
尝试这个:
$('div.dtNode:has(a.nodeSel)').addClass("newClass");
这会将名为“newClass”的类添加到具有类“dtNode”的 div 中,并包含具有类“nodeSel”的“a”标签
div 的最终 html 将是:......
这是你想要的 ?