beginner beginner - 1 year ago 53
HTML Question

How to find next "p" sibling of "this" element using jquery?

We know we can use following syntax to select next element.

$("div + p")

It selects
element that are next to each
I want to select the next element using this.
for example
I tried

$("this + p") or
$(this + p")

But not working. Can anyone tell me correct syntax.

Answer Source

You can select next sibling of element using .next(). Use it like bottom example: