jQuery one() Method
jQuery one() Method
The one() method is used to attach one or more event handlers for the selected elements. It specifies a function to run when the event occurs. In this, the event handler function only runs once for each element.
Syntax:-
Its syntax is:- $(selector).one(event,data,function)
Further Explanation:-
Parameter | Description |
---|---|
event | Required. Specifies one or more events to attach to the elements. |
data | Optional. Specifies additional data to pass along to the function |
function | Required. Specifies the function to run when the event occurs |