I'm trying to use .html() or .contents() but i have strange behaviours
I basically need to get the entire dom of the page, exclude some elements (ex. #first, #second) and the pass it as a string, not a dom anymore...
is it possible?
I'm trying to use .html() or .contents() but i have strange behaviours
I basically need to get the entire dom of the page, exclude some elements (ex. #first, #second) and the pass it as a string, not a dom anymore...
is it possible?
You can clone it, remove the elements you want to exclude from the clone, and then return the clone's html:
$('body').clone().find('#first,#second').remove().end().html()