The ("element + next") selector selects the "next" element of the specified "element". The "next" element must be placed right after the specified "element" to be selected.
Example: If you have two <p> elements right after a <div> element, this syntax:
Example: If you have an <h2> element right after a <div> element, and then a <p> element, this syntax:
Note: Both of the specified elements must share the same parent.
Parameter | Description |
---|---|
element |
Required.
Any valid jQuery selector |
next | Required. Specifies the element that should be the next element of the element parameter |
Select
the <div> element that are next to each <ul> element
How to select the <div> element that are next to each <ul> element.