Tag Archives: jquery training course
jQuery nextAll method
jQuery “nextAll()” method is used to get all the next siblings of the matched elements.
Syntax : jQuery nextAll() method
$(selector).nextAll(selector-element);
selector-element : Is optional, you can add selector-element to get next element.
jQuery nextAll Method Example 1
jQuery nextAll Method Example 2
jQuery map method
jQuery “last()” method passes each element in current matched set using a function which generates new jQuery objects and returns value.
Syntax : jQuery map() method
$(selector).map(function(index,element));
index : Index of current element.
element : Current element.
jQuery map Method Example
jQuery last method
jQuery “last()” method is used to get the last element of the selected elements.
Syntax : jQuery last() method
$(selector).last();
Note : It accepts no parameter.
jQuery last method Example
jQuery is method
jQuery “is()” method is used to match the current set of elements against the jQuery selector,jQuery Object or jQuery element. If argument matches any of these elements it returns true .
Syntax : jQuery is() method
$(selector).is(selector-element,function(index,element));
selector-element: Pattern to match the current set of elements against selector-element.
– index : Current index of element.
– element : Current element.
jQuery is() Example
jQuery has method
jQuery has method is used to get the elements which contains the particular element inside it.
Syntax : jQuery has method
$(selector).has(element);
element: Pattern to match the elements which has the supplied element in has method.
jQuery has Example
jQuery first method
jQuery first method() is used to get the first element of the selected element.
Syntax : jQuery first method
$(selector).first();
Note : It accepts no arguments.
jQuery first method Example
jQuery find method
jQuery find() method is used to get all descendant elements of the selected element.
Syntax : jQuery find() method
$(selector).find(filter);
filter:
– An element or string which contains the selector expression to match the elements.
jQuery find method Example
jQuery filter method
jQuery filter method() is used to get elements that match the specified pattern.
Syntax : jQuery filter method
$(selector).filter(criteria,function(index));
Criteria:
– Selector expression to match the current set of elements.
Function:
– Function used to run for each elements. this represents current DOM.