Search code examples
jqueryattachevent

Attaching JQuery Events to "on the fly created" controls


I'm appending to an existing div in my page. The appended text contains html code in string. The problem is, events aren't working when I add click on them after appending to page. I guess Jquery loads control on page load and I have to do something to attack the events again.


Solution

  • Try to use .live() or .delegate for this purpose.