How to attach an event handler only once?

jQuery offers various event methods for assigning specific event listeners . Normally, jQuery methods will occur as many times as the trigger event is triggered, but when you use jQuery .one() method , the code that attached to only gets executed once per page load.

The jQuery one() method adds event handlers to the selected element. The handler is executed at most once per element per event type.

run this source code Try it Yourself

Full Source

 (C) 2023    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About