Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to resolve conflicts with other libraries?

860


How does jquery store data related to an element?

767


What are the effects methods used in jquery?

845


What is the difference between jquery.get() and jquery.ajax()?

889


Define animate function in jquery?

814


How do you add an HTML element in DOM tree?

846


What is the use of val() method in jquery?

863


How to give face effect in jquery?

815


What are the different types of selectors?

846


Can we call c# codebehind method using jquery?

766


How can you apply a style on an element using jQuery?

875


Mention the advantages of cdn? : jQuery Mobile

889


Which operating system is more compatible with jQuery?

896


What is event preventdefault () and event stoppropagation () in jquery?

740


Can jquery be used to make an ajax request?

810