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
How do I check if an element is hidden in jQuery?
How do you add an HTML element in DOM tree?
Tell me which command will give a version of jquery?
What is jquery connect and how to use it?
what are the features of jquery
Do we need to add jQuery file in both Master and Content page?
How to use jquery?
Tell me how to check data type of any variable in jquery? : jquery mobile
Can there be more than one ready function in jquery?
When can you use jquery?
What is the use of jQuery load method?
Explain data paremeter of jquery ajax method?
Explain the difference between .js and .min.js? : jquery mobile
Can we call C# code behind using jQuery?
What are the advantage of using minimized version of jquery?