Home >Web Front-end >JS Tutorial >Getting Started with JQuery - Use the one() method to bind event processing functions (triggered only once)_javascript skills

Getting Started with JQuery - Use the one() method to bind event processing functions (triggered only once)_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:42:021232browse

1. The one() method function is to bind a processing function that is only triggered once to the selected element. The syntax format of its call is: one(type, [data], fn)

The parameter type is the event type, that is, what type of event needs to be triggered; the parameter data is an optional parameter, indicating the additional data object passed to the event object as the event.data attribute value; fn is what is to be triggered when binding the event function.

2. Sample code :

Copy code The code is as follows:





Other events











3. Rendering preview :


After clicking:

No response when clicking again

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn