Search code examples
jqueryjquery-filter

Difference between .is and .filter in jQuery


Can I ask what the function is of .is and .filter in jQuery, and what is their difference?


Solution

  • .is() returns true if at least one of the elements you're calling it on matches the selector.

    .filter() returns only those elements from the set you're calling it on which match the selector

    The proper definitions and examples can be found at: .is() and .filter()

    Hope that helps..?