, but
I do not use the clone(), instead, copy the html:
var newp = $('#another_p').html( $('test').html() )
and then I remove the anchor:
newp.find('a.here').remove()
The problem is, event handler of the origin anchor( '#test a.here' )
are removed as well.
This problem only happens in IE.
The cause is IE takes
elem[ expando ] = ++uuid;
as
elem.setAttribute( expando, ++uuid );
so the statement:
$('test').html()
will return something like this:
<p id="test"><a class="here" href="#somewhere" jquery20080519="61">.....
when append this html piece to another element and remove the anchor,
the jquery cache with key 61 will also be removed
I know this usage is strange, but I think the solution is simple as
well: just remove expando before return the innerHTML
452 html: function( value ) {
453 return value == undefined ?
454 (this.length ?
455 this[0].innerHTML :
456 null) :
457 this.empty().append( value );
458 },