Easy Tutorial
❮ Ajax Post Event Focus ❯

jQuery one() Method

jQuery Event Methods

Example

When clicking a <p> element, increase the text size of that element (each <p> element can trigger the event only once):


Definition and Usage

The one() method adds one or more event handlers to the selected elements and specifies a function to run when the event occurs.

When using the one() method, the event handler function can run only once for each element.


Syntax

Parameter Description
event Required. Specifies one or more events to add to the elements. <br> <br>Multiple event values are separated by spaces. Must be valid events.
data Optional. Specifies additional data to pass to the function.
function Required. Specifies the function to run when the event occurs.

jQuery Event Methods

❮ Ajax Post Event Focus ❯