append() doesn't add event handlers
I am noticing a strange thing:
Trying to add new HTML elements to the document using the jQuery append() function it seems it doesn't add event handlers to the newly created elements.
jQuery only seems to add these in Internet Explorer:
<a href="#" onclick="alert('...'); return false;">Test</a>
In Opera, Safari and Google, all my hyperlinks look something like this:
<a href="#">Test</a>
This code is similar to what I have written:
body.append('
<a href="#" onclick="alert(\'...\'); return false;">Test</a>
');
What am I doing wrong here?
Your help is appreciated.