How to remove following simple text without enclosing element?

How to remove following simple text without enclosing element?

Assume the following code

  1. <p class="firstclass">.....</p>
  2. foobar some text
  3. <p class="secondclass">.....</p>
  4. some other text

Now when I apply

$(".firstclass").nextAll().remove();

then the text following the <p>firstclass element is NOT removed since it is not enclosed in an element.
As I learned nextAll() fetches only elements.

How can I otherwise remove ALL following stuff after <p> firstclass?

Peter