next

#英[nekst] 美[nɛkst]

adj. Immediately after; second to; close to; immediately adjacent

adv.Go on;then;behind;sequentially

n.next;next one

prep.Close;behind;next door to…

jquery next() method syntax

Function:next() obtains the sibling elements immediately adjacent to each element in the matching element set. If a selector is provided, retrieves the next sibling element that matches the selector.

Syntax:.next(selector)

Parameters:

Parameter Description
selector String value, containing the selector expression used to match elements.

Description:If given a jQuery object that represents a collection of DOM elements, the .next() method allows us to search for elements in the DOM tree followed by sibling elements and constructs a new jQuery object with the matching element. The method accepts an optional selector expression of the same type that I passed into the $() function. If the following sibling element matches the selector, it will remain in the newly constructed jQuery object; otherwise, it will be excluded.

jquery next() method example

    

Hello

Hello Again

And Again
Run instance »

Click the "Run instance" button to view the online instance