According to here, jquery\'s remove function should work like so..
$(\'div\').remove(\'selector\');
Which I\'m trying in this example.
You've misunderstood what the documentation is saying. It's not looking for elements that are descendants of the matched elements that match the selector, it's simply filtering down the set of already matched elements to those that match the selector, and then removing them.
If you have this HTML:
Some text
Some more text
Some unwanted text
and then executed this jQuery:
$('div').remove('.unwanted');
then it would only remove that third Example jsFiddleunwanted
class on it), because it first selects all