How do you attach a event to element which should be executed only once?
Answer Posted / chaitanya
Using jQuery one() method. This attaches a handler to an event for the element. The handler is executed at most once per element. In simple terms, the attached function will be called only once.
Hide Copy Code
$(document).ready(function() {
$("#btnDummy").one("click", function() {
alert("This will be displayed only once.");
});
});
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain jquery filter?
Explain how jquery works?
How to programmatically trigger a click event thats being handled by jquery only?
Is jquery a library for client scripting or server scripting? : jquery mobile
Explain chaining in jquery? : jquery mobile
How to debug jQuery?
Describe the two types of cdns?
Explain animate function in jquery?
What is eq()? : jquery mobile
Tell me how to select combobox select value and text using jquery?
How to Use the jQuery load() Method?
Explain the difference between javascript and jquery? : jquery mobile
How to check jQuery version?
Define the use of each function in jquery?
Do you have plans for a new jquery plug-in or something else we should look out for? Where to from here for the imgpreview plugin?