0
所以我想使用jQuery选择这样一个元素的非固定兄弟:的jQuery选择父
<div>
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
<ul>
</div>
<div>Item to be operated on when the first li is clicked.</div>
<div>Item to be operated on when the second li is clicked.</div>
<div>Item to be operated on when the third li is clicked.</div>
当然,我期待开始我的jQuery的功能与
$('ul li')
有没有办法做到这一点,没有多个DOM潜水?我基本需要的是“next()。next()。next()”,如果它不只是直接操作兄弟。假设我无法移动标记。谢谢。
需要'指数()+ 1',列表中包含了'div'内以及 – billyonecan
@billyonecan:此HTML需要一些类。谢谢,我会加入。 – Blender