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
What is meant by the term ‘theming’ in jquery mobile? : jQuery Mobile
Do we need to add jQuery file in both Master and Content page?
What is event.PreventDefault in jQuery?
Differentiate the concepts of .js and .min.js?
What are the advantages of minified version of jquery?
How to check variable is empty or not in jquery?
What are the various ajax functions available in jquery ?
What is difference between .setinterval() and .delay() ?
What are the types of selectors in jQuery?
Does jquery follow w3c recommendations?
Define the types of selectors in jquery?
How to execute jQuery code after the DOM is ready?
Explain source maps in jquery? : jquery mobile
How do you install/use jquery in a project.
Jumping off of jquery ui for a second, do you 'release early, release often' with all of your projects? What are your thoughts on that strategy?