beginner beginner - 5 months ago 17
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.


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