Hola.js DocumentationBlogBlogSupport UsSupport UsAboutAboutContact ↗Contact ↗ (opens in a new tab)
GitHubGitHub (opens in a new tab)
  • Hola.js Intro
  • Install Hola.js
  • Hello World
  • Event Methods
    • Blur(callback)
    • Change
    • Focus
    • Hover
    • Keydown
    • Keyup
    • Mousemove
    • Off
    • On
    • One
    • Submit
    • Trigger
  • Filtering Methods
    • Eq
    • Filter
  • Insertion Methods
    • After
    • Append
    • Before
    • Prepend
  • Selection and Manipulation Methods
    • Addclass
    • Attr
    • CSS
    • Hide
    • HTML
    • Removeattr
    • Removeclass
    • Show
    • Text
    • The $ Object
    • Toggleclass
  • Traversal Methods
    • Children
    • Find
    • Parent
    • Siblings
  • Hola.js Intro
  • Install Hola.js
  • Hello World
  • Blog
  • Support Us
  • About
  • Contact ↗ (opens in a new tab)
  • Event Methods
    • Blur(callback)
    • Change
    • Focus
    • Hover
    • Keydown
    • Keyup
    • Mousemove
    • Off
    • On
    • One
    • Submit
    • Trigger
  • Filtering Methods
    • Eq
    • Filter
  • Insertion Methods
    • After
    • Append
    • Before
    • Prepend
  • Selection and Manipulation Methods
    • Addclass
    • Attr
    • CSS
    • Hide
    • HTML
    • Removeattr
    • Removeclass
    • Show
    • Text
    • The $ Object
    • Toggleclass
  • Traversal Methods
    • Children
    • Find
    • Parent
    • Siblings
Question? Give us feedback → (opens in a new tab)Edit this page
Filtering Methods
Filter

filter

This method can be used to filter the elements in the collection based on a selector or a function.

// Filter the elements based on a selector
filter: function(selector) {
  return $(this.elements.filter(function(element) {
    return element.matches(selector);
  }));
},
 
// Filter the elements based on a function
filter: function(fn) {
  return $(this.elements.filter(function(element) {
    return fn(element);
  }));
}
EqAfter

Hola.js Doc