Not sure if the title is right, please suggest changes if you disagree.
I was working with content loaded via jquery (.load()) into a div. I had to remove couple items from the loaded content. I've done so in the same manner as in the jsfiddle example I wrote ( http://jsfiddle.net/AzxaL/12 ). This one does not use load() function which creates id duplication, but this is irrelevant.
The question is: why one work and another does not and what needs to change in else if(this.tagName == 'H2') { $(this).remove(); } of the not working example?
To save you hunting down differences, the only one is in the /* line of interest */
Working
$('#copy_working_box').html($('#copy_working_box').children('#wrapper').children()).fadeIn(300);
Not working
$('#copy_working_not_box').html(content).fadeIn(300);
Also, please notice that in the not working example the div#subcontent does get removed it is only the h2 that is not.
P.S. I'm looking for clarification as I understand that this issue exists only because of my flawed understanding of how this example works.
Thanks in advance.