TheFilmGod Posted July 7, 2009 Share Posted July 7, 2009 I have dynamically created content using javascript. However, it seems like I can't get of the dynamically generated content to fire events when clicked. The only thing i could find on google about this "event does not fire unless appended to DOM..." anyone care to help me? Quote Link to comment Share on other sites More sharing options...
TheFilmGod Posted July 7, 2009 Author Share Posted July 7, 2009 I finally figured out after like 2 hours of grueling agony. I remapped all the events onto the events immediately after the innerhtml. The reason is simple - the elements did not exist before innerhtml so the program needs to remap the new events onto the elements after they are created. Google has let this miracle happen. 2+ hours of searching got me to finally find the answer. Quote Link to comment Share on other sites More sharing options...
haku Posted July 7, 2009 Share Posted July 7, 2009 That's a pretty common error. You have to attach handlers to newly created elements. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.