jQuery closest class selector

后端 未结 6 613
野的像风
野的像风 2021-01-01 10:19
Click me
Information
6条回答
  •  滥情空心
    2021-01-01 10:50

    closest travels up the dom tree. it won't find something thats a sibling. you can use a find on a parent to achieve this

    $('.Level2').click(function(){
           $(this).parent().find('.Level3').fadeToggle();
        });
    

提交回复
热议问题