select one element from same class using jquery

At times, you may come across a situation when you need to select one element from same class. jQuery makes is very simple to select an element from same class.

Lets setup an example of five paragraph which share same class.

Now, we want to change the color of third paragraph, only. Following script will work for us.

:eq() is one of the index-selectors. Other index-selector are :lt() :gt() :odd() :even. Try to play with them ,too.



eq-selector @ api.jquery.com