According to here, jquery\'s remove function should work like so..
$(\'div\').remove(\'selector\');
Which I\'m trying in this example.
You're trying to remove something that is both div and p.unwanted. The filter in remove() is applied to the current set of nodes, which in this case is all div elements.
Use the children set instead:
$('div').children().remove('p.unwanted');