jQuery - Finding next Div

前端 未结 5 1297
逝去的感伤
逝去的感伤 2021-02-13 12:47

I am trying to find the next div after an input button and toggle it.

What am I doing wrong?

JS:

$(\".showNextExperience\").click(function() {
          


        
5条回答
  •  粉色の甜心
    2021-02-13 13:15

    Try this

    $(".showNextExperience").click(function() {
        $(this).next("div.experience").toggle();
    });
    

提交回复
热议问题