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
Event Methods
One

one

This method can be used to attach an event listener to the elements in the collection that will be removed after the first time it is triggered.

// Attach an event listener that will be removed after the first trigger
one: function(eventType, handler) {
  this.elements.forEach(function(element) {
    element.addEventListener(eventType, function oneHandler() {
      handler.apply(this, arguments);
      element.removeEventListener(eventType, oneHandler);
    });
  });
  return this;
}
OnSubmit

Hola.js Doc