Yeah, that's expected - you would need to bind the event handler,
attributes, etc. etc. before you run insertAfter. We might want to
look at making that not the case, at some point, but that would
require an API change.

If you're interested in that, you should file a feature ticket here:
http://dev.query.com/newticket

--John



2009/1/29 Dave Brondsema <d...@brondsema.net>:
>
> If I run $('<span>foo</span>').insertAfter('p') and there are for
> example 2 <p>s, it will insert 2 <span>s.  But the return value of the
> code is only the first <span>.  So if I want to chain an onclick
> handler after that, it only gets bound to the first <span> not all the
> inserted ones.  Is that normal?  Is there a better way to do it?
>
> See example at http://jsbin.com/eyuwo and look at the firebug console
> output.
>

Reply via email to