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.
$(this).parent().next().css('display','none');
以上仅隐藏当前兄弟旁边的兄弟。
如果有多个,将失败。
你需要使用nextAll()
nextAll()
$(this).parent().nextAll().css('display','none');
甚至更好:
$(this).parent().nextAll().hide()