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?



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

Post New Answer

More jQuery Interview Questions

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

0 Answers  


What are selectors in jquery? : jQuery Mobile

0 Answers  


What is the difference between event.PreventDefault and event.stopPropagation?

1 Answers  


How do you check if an element is empty?

1 Answers  


How to Use the jQuery load() Method?

0 Answers  


What is the difference between parent() and parents() methods in jQuery?

1 Answers  


What were the biggest challenges of getting the jQuery 1.7 release ?

0 Answers  


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

0 Answers  


How can jquery library be added to pages? Write a basic jquery code?

0 Answers  


Difference between javascript and jquery? : jQuery Mobile

0 Answers  


What are jquery selectors?

0 Answers  


Consider a scenario where things can be done easily with javascript, would you still prefer jQuery?

1 Answers  


Categories