How do I select the next “n” elements starting from the current element in jQuery?

后端 未结 3 760
离开以前
离开以前 2021-02-05 00:00

How do I select the next \"n\" elements starting from the current element? What I mean is...

 $(this).attr(...);

I want to do this \"n\" times

3条回答
  •  忘了有多久
    2021-02-05 00:29

    the nextAll method selects the following siblings of an element, optionally filtered by a selector. You could then follow that with a slice to restrict to a smaller n.

提交回复
热议问题