我的代码示例:jQuery的穿越在同一水平上
<section id="reports">
<div class="report">
<div class="report-expand">MORE</div> <!-- this one is clicked -->
</div>
<ul class="report-moreinfo"></ul> <!-- I want to select this one -->
<div class="report">
<div class="report-expand">MORE</div>
</div>
<ul class="report-moreinfo"></ul>
<div class="report">
<div class="report-expand">MORE</div>
</div>
<ul class="report-moreinfo"></ul>
</section>
这是我的jQuery的一部分:
$('.report').on('click', '.report-expand', function(e) {
// $(this) === '.report-expand'
$(this).closest('.report') // now what..?
}
如何完成穿越正确选择下面的.report
的ul.report-moreinfo
我目前选择了?
我结束使用'$(event.delegateTarget).next();' - - 谢谢!我实际上已经尝试过'$(this).closest()。next();'但之前在代码中存在一个.remove(),这使得我认为我做错了一些事情。 –