Jquery filtering

jquery first() method

the jquery .first() method reduce the set of matched elements to the first in the set.

the jquery first method syntax :-

             $ (selector).first ()

the jquery first method example


jquery last() method

the jquery .last() method reduce the set of matched elements to the final one in the set.

this method does not accept any arguments.

the jquery last method syntax :-

(selector).last () 

the jquery last method example


jquery eq() method

the .eq() method reduce the set of matched elements to the one at the specified index.

the jquery eq method syntax :-

            $ (selector).eq (index )
parameterdescription
indexrequired. specifies the position of the element.index start from zero.

jquery eq method example