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

Explain jquery filter?

1129


Explain how jquery works?

822


How to programmatically trigger a click event thats being handled by jquery only?

794


Is jquery a library for client scripting or server scripting? : jquery mobile

732


Explain chaining in jquery? : jquery mobile

797


How to debug jQuery?

939


Describe the two types of cdns?

829


Explain animate function in jquery?

804


What is eq()? : jquery mobile

890


Tell me how to select combobox select value and text using jquery?

832


How to Use the jQuery load() Method?

888


Explain the difference between javascript and jquery? : jquery mobile

761


How to check jQuery version?

994


Define the use of each function in jquery?

766


Do you have plans for a new jquery plug-in or something else we should look out for? Where to from here for the imgpreview plugin?

777