The jQuery one() Method attached a handler for the selected elements and executed at most once per element per event type.
Using one() method, the event handler is only run ONCE for each element.
Possible event values are: blur, load, focus, resize, unload, scroll, click etc.
This is the simple syntax for using this method −
selector.one( type, [data], fn )
$( "#elementID" ).one( "click", function() {
alert( "Item will be displayed only once." );
}); Above code is equivalent with:
$( "#elementID" ).on( "click", function( event ) {
alert( "Item will be displayed only once." );
$( this ).off( event );
}); This is the description of all the parameters used by this method −
Read Also: jQuery bind() and unbind() – attaching event handlers
For more information Click Here.
When you are looking to apply for a mortgage the one thing that most people…
Once you've memorized basic blackjack strategy, it's time to delve deeper into the game. Advanced…
Yoga is no longer just a physical practice. Yoga is popular as a lifestyle practice.…
Best Crypto Sign-Up Bonuses in India 2026: Ranked & Compared Every exchange claims to have…
One of the world's busiest travel hubs, New York City relies heavily on coach bus…
Whether large scale or small scale, many businesses want to market their services or products…