Take the 2-minute tour ×

Before jQuery 1.8 I was able to use .live() to fire when a button was clicked that was dynamically inserted by jquery.

Now, .on() and .bind() both do not work for elements added to DOM after the page was loaded.

What are the options now?

share|improve this question
Wrong. Read the documentation for .on(). –  SLaks Apr 7 '13 at 22:36
.on() does work if you pass the appropriate parameters. Did you read the doco? If you read the doco for .live() it tells you how to convert to .on()... –  nnnnnn Apr 7 '13 at 22:36
Yes, I've ready the docs but I'm not able to get it functioning in the same way. What the "appropriate parameters"? –  Adam Apr 7 '13 at 22:41
Got it working, realized it had to be applied to the document level like this: $(document).on("click", "#ButtonID", function(e){ –  Adam Apr 7 '13 at 22:43
show 1 more comment

2 Answers

up vote 3 down vote accepted
$(parent_element).on("click", child_selector, function(evt) {



share|improve this answer
add comment

delegate is far efficient than on handler

$(document).delegate('click', "selector", function() {
    //your stuff
share|improve this answer
add comment

Your Answer


