Certain applications require triggering of event handlers just once. If an event handler is wired using the .on()
method, it is triggered every time the event occurs, which may be undesirable in such situations. This recipe demonstrates how to attach an event handler for one-time invocation. The constructs used in this example are summarized as follows:
Construct |
Type |
Description |
---|---|---|
|
jQuery selector |
This matches all elements with the specified CSS class. |
|
jQuery selector |
This selects all elements with the specified HTML tag. |
|
jQuery selector |
This selects an element with the specified attribute equal to the |
|
jQuery event |
This is fired when you click on an element. It corresponds to the JavaScript |
|
jQuery method |
This hides the matched elements. |
|
jQuery event binder |
This attaches an event handler for one or more events to the matched elements. The... |