#20 jQuery Filtering Methods | first Method | last Method | eq Method | filter Method | not Method

preview_player
Показать описание
Filtering methods allow us to search for a specific element in a group of elements.

Below Filtering Methods select a specific element based on its position :-
first
last
eq

Below Filtering Methods select elements that match, or do not match, a certain criteria :-
filter
not

jQuery first Method :-

jQuery first method returns the first element from the group of elements.

jQuery first Method Example :-

The example in video returns first div element out of many div elements.

jQuery last Method :-

jQuery last method returns the last element from the group of elements.

jQuery last Method Example :-

The example in video returns last div element out of many div elements.

jQuery eq Method :-

jQuery eq method returns element with specific index number from the group of elements.

The index numbers start at 0, so the first element will have the index number 0 and not 1.

jQuery eq Method Example :-

The example in video returns div element with index number 1 out of many div elements.

jQuery filter Method :-

jQuery filter method returns element with specific criteria from the group of elements.

jQuery filter Method Example :-

The example in video returns div element with class “selected” out of many div elements.

jQuery not Method :-

jQuery not method returns all elements that do not match the criteria from the group of elements.

jQuery not Method Example :-

The example in video returns div elements that does not have class “selected”.

Join this channel to get access to perks:
Рекомендации по теме
welcome to shbcf.ru