Easy Tutorial
❮ Sel Lastchild Event Mouseup ❯

jQuery element + next Selector

jQuery Selectors

Example

Select the <p> element immediately following each <div> element:


Definition and Usage

The element + next selector selects the "next" element immediately following the specified "element". The "next" element must be placed to the right of the specified "element".

Example: If there are two <p> elements to the right of a <div> element, the syntax would be:

Example: If there is an <h2> element to the right of both a <div> element and a <p> element, the syntax would be:

Note: The two specified elements share the same parent element.


Syntax

Parameter Description
element Required. Any valid jQuery selector.
next Required. Specifies the element that must be next to the element parameter.

Try it - Example

Select the <div> element immediately following each <ul> element


jQuery Selectors

❮ Sel Lastchild Event Mouseup ❯