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 |
Mention the advantages of cdn? : jQuery Mobile
How to set jquery mobile responsive table width to 100% width despite css styles? : jquery mobile
Mention some advantages of jquery.
You get "jquery is not defined" or "$ is not defined" error. What could be the reason?
What are the advantages of minified version of jquery?
Explain some benefits of jquery knockout?
Explain the difference between jquery.size() and jquery.length?
Define the use jquery.data method?
How can we include jQuery library in ASP.Net project?
What is the use of delay() method in JQuery?
What is meant by a deep copy? : jQuery Mobile
Does jQuery 2.0 supports IE?