i just want to bring this up for discussion to see what people have to
say about it and to further my understanding of how jquery works and
why it works that way. maybe its a bug?

imagine the base code <b>Hello World!</b>

// fails to assign click handler:
$("b").wrap($("<a href='#'/>").click(function(){
    alert("foo");
}));
// also fails... wrapAll, wrapInner etc


// works as expected:
$("b").replaceWith($("<a href='#'>Hello World</a>").click(function(){
    alert("foo");
}));
// also works as expected: html, prepend, append, after, before,
etc...


i found this odd. thoughts?

Reply via email to