I have a listener on DOMContentLoaded which calls startup() function.
I want to add more listeners (within the startup function) to items added to the DOM in the startup function. But it seems to fail (no click event registetered)
I use item.addEventListener("click", f, false); where f is the function that is supposed to run.
NOTE: I CANNOT use onclick=… I also cannot use JQuery.
You have several issues in your code:
previousfunction is not definedclicknotonclick.addListenersoutside of yourloadfunction.Here is a jsfiddle that works: http://jsfiddle.net/VUgRu/
You should always use the javascript console to see what errors you are getting.