I think what you are trying to do:
var htmlcontent = $('.content').remove(".dontgrab").html();
You can use .not () if the situation were like this:
var htmlcontent = $('div').not(".dontgrab").html();
<body>
<div class="content">
BEFORE
AFTER
</div>
<div class="content dontgrab">DON'T GRAB</div>
</body>
I do not think you can use .not for selected children elements. I hope this helps
source
share