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 id="nums"> <div id="d0"></div> <div id="d1"></div> <div id="d2"></div> <div id="d3"></div> </div>
如何获得所有divs内部nums和之后div 1
divs
nums
div 1
更改了您的 ID,因为 ID 不能以整数开头。没关系,看评论。
$('#1').nextAll('div')
$("div#nums div#1").siblings("div")
$('div#nums div').not('div#d1');
或者
$('div#nums div#d1').siblings('div');