Why not just use the .click() method of jQuery instead? Like this: $(document).ready(function(){ $("body").append($('<a>').click({alert('test');return false}).text ("Dynamic")) ; });
On Dec 18, 12:47 am, gorfbox <gorf...@gmx.de> wrote: > Hi folks, > > I'm having a dickens of a time with something that should be easy. > When using $("body").append to place an anchor containing an "onClick" > statement in the html body, the code is executed and the anchor is > shown, but the onclick doesn't work. Strangely enough, if an anchor > with an onClick is statically placed in the html code it works fine. > > This only happens when using the browser shown in Outlook; Chrome and > IE8 have no problems. Here's the code I'm using... > > http://pastie.org/748407 > > Any help would be greatly appreciated. > > Gorfbox