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.
我有以下html:
<div> <div class="A">Some details</div<> <div class="B">Some details</div<> <div class="C">Some details</div<> </div>
当“this”包含class = A div时,从$(this)开始选择class =“C”的div的正确jquery语法是什么?
干得好:
$(this).siblings('div.C');
这应该可以解决问题。
$(this).parent().find('.C')
这可能会解决您的问题
$(this).parent().find(">div.C")
或者
$(this).siblings(".C")