I have an AJAX routine that calls a script that generates content that is dynamically => <div id="testdiv">inserted</div>.
I want to trap a click event:
[code=text]
$('testdiv').addEvent('click', function(){
alert('Hello');
});
[/code]
But I'm getting an error message: 'null' is null or not an object
It works fine for hard coded code, but not code in the dynamically populated DIV.
Why? Workaround?



Reply With Quote


Bookmarks