Home  >  Article  >  Web Front-end  >  What does eq mean in jquery

What does eq mean in jquery

WBOY
WBOYOriginal
2021-12-13 11:01:005869browse

eq means: 1. The ":eq()" selector, which can select elements with a specified index value, and the syntax is "$(":eq(index)")"; 2. The "eq()" traversal method can return elements with the specified index number of the selected element. The syntax is "$(element).eq(index)".

What does eq mean in jquery

The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.

What is the meaning of eq in jquery

1. It represents: eq() selector.

: The eq() selector selects elements with the specified index value.

index values ​​start from 0, and the index value of all first elements is 0 (not 1).

is often used with other elements/selectors to select elements with a specific sequence number in a specified group.

The example is as follows:





 

Welcome to My Homepage

My name is Donald

I live in Duckburg

My best friend is Mickey

Who is your favourite:
  • Goofy
  • Mickey
  • Pluto

Output result:

What does eq mean in jquery

2. It represents the eq() traversal method.

eq() method returns the element with the specified index number of the selected element.

Index numbers start with 0, so the index number of the first element is 0 (not 1).

The example is as follows:




123



欢迎来到我的主页

我的名字叫Donald (下标 0).

Donald Duck (index 1).

我住在 Duckburg (index 2).

我最好的朋友是 Mickey (index 3).

Output result:

What does eq mean in jquery

Related video tutorial recommendation: jQuery video tutorial

The above is the detailed content of What does eq mean in jquery. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn