jQuery Misc index() Method
jQuery index() Method
The index() method is used to return the index position of specified elements relative to other specified elements. It can be specified by jQuery Selectors or DOM elements. If that element is not found, the index() method will return -1.
Syntax:-
Its syntax is:- $(selector).index(element)
Further Explanation:-
Parameter | Description |
---|---|
element | Optional. Specifies the element to get the index position. |