jQuery slice() Method
jQuery slice() Method
The slice() method is used to select a subset of elements based on its index. A subset is a set that is a part of a larger set. It is actually used for limiting the selection. By specifying the start and end points, we can describe from where to start a subset and where to end it.
Syntax:-
Its syntax is:- $(selector).slice(start, stop)
Further Explanation:-
Parameter | Description |
---|---|
start | Required. Specifies where to start the selection of elements. Index starts from 0. |
stop | Optional. Specifies where to end the selection of elements. If not set, it will select till the end. |