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

What is meant by the term ‘theming’ in jquery mobile? : jQuery Mobile

812


Do we need to add jQuery file in both Master and Content page?

835


What is event.PreventDefault in jQuery?

898


Differentiate the concepts of .js and .min.js?

955


What are the advantages of minified version of jquery?

847


How to check variable is empty or not in jquery?

962


What are the various ajax functions available in jquery ?

777


What is difference between .setinterval() and .delay() ?

856


What are the types of selectors in jQuery?

990


Does jquery follow w3c recommendations?

883


Define the types of selectors in jquery?

900


How to execute jQuery code after the DOM is ready?

855


Explain source maps in jquery? : jquery mobile

838


How do you install/use jquery in a project.

880


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?

858