Home >Web Front-end >JS Tutorial >Example of usage of eq() method in jQuery_jquery
The example in this article describes the usage of the eq() method in jQuery. Share it with everyone for your reference. The specific analysis is as follows:
This method can get the element with the corresponding position index on the matching element set.
The position index of the element in the matching element set starts from 0.
Grammar structure:
Parameter list:
Example code:
Example 1:
Set the font color in the li element with index 1 to blue.
Example 2:
When the index is negative, count backwards from the last element.
I hope this article will be helpful to everyone’s jQuery programming.