List different types of filters available in jquery?

devquora
devquora

Posted On: Feb 22, 2018

 

For filtering, jQuery provides various functions such as filter(), first(), last(), eq(), slice(), has(), and not().

  • The filter() method takes an expression and a function as arguments. It filters the expression with the applied elements and returns only the element that matches the filter. The first() method returns the first element from the set of matched elements.
  • The opposite of the first() is the last() method. It returns the last element from the matched set of elements.
  • The eq() method is used to filter the set of matched elements and returns the element with the specified index number.
  • The has() method filters the set of matched elements and returns only the element that has the specified descendant element.
  • The not() method is used to filter the elements and return the elements that don’t match the specified condition.
  • The slice() method filters the element specified by the range of indices.

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    JQuery Interview Questions

    What is jQuery?

    jQuery is a lightweight JavaScript library which gives a quick and simple method for HTML DOM traversing and manipulati..

    JQuery Interview Questions

    What are the advantages of JQuery ?

    There are many advantages of JQuery. Some of them are :It is more like a JavaScript enhancement so there is no overhea..

    JQuery Interview Questions

    What are the different type of selectors in Jquery?

    There are 3 types of selectors in JqueryCSS Selector XPath Selector Custom Selector..