Page 1 of 1

What to research for new elements with event listeners?

Posted: Sun Apr 27, 2008 4:29 pm
by JAB Creations
What should I research online to figure out how to get event listeners to recognize when new elements created by JavaScript (not via AJAX but just by a function) exist? The event listeners are loaded on my site onload, a user takes an action 40 seconds after the page loads that creates a new element via createElement, they click on the element however the event listeners don't see the newly created elements. Suggestions please?

Re: What to research for new elements with event listeners?

Posted: Mon Apr 28, 2008 9:59 am
by pickle
Put the code that adds the event listeners in a function x(). Call that function when a new element is created - not by listening, but by calling the x() when the code to create the new element is executed.