index

UK[ˈɪndeks] US[ˈɪnˌdɛks]

n.index;index;indication;sign

vt. Index...; Index...; [Economics] Adjust according to living index (wages, prices, etc.)

vi.[Mechanics] Transposition

jquery index() method syntax

Function:index() method returns the index position of the specified element relative to other specified elements. These elements can be specified via jQuery selectors or DOM elements. If the element is not found, index() will return -1.

The index of the first matching element is equivalent to the sibling element:Get the index position of the first matching element relative to its sibling elements.

Syntax:$(selector).index()

The index of the element, equivalent to the selector:Get the element relative to The index position of the selector. The element can be specified via a DOM element or a jQuery selector.

Syntax:$(selector).index(element)

##Parameters:

jquery index() method example

    

点击列表项可获得其相对于同胞元素的 index 位置:

  • Coffee
  • Milk
  • Soda
Run instance »

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

About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!
Parameter Description element Optional. Specifies the element to obtain the index position. Can be a DOM element or a jQuery selector.