How do you attach a event to element which should be executed only once?
Answer / 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 |
How to delete cookies in jquery?
How to keep the submit text from showing with jquery mobile? : jquery mobile
How to load jQuery locally when CDN fails?
How can you select all elements in a page using jquery?
Jquery can be used in what scenarios?
what is the use of param() method in jquery .
How to create clone of any object using jQuery?
Explain url paremeter of jquery ajax method?
Can you write a code to select all links inside the paragraph?
Tell me do I need to add the jquery file both at the master page and content page as well?
What is jquery.holdready() function?
What is the difference between .js and .min.js?