How to remove following simple text without enclosing element?
Assume the following code
- <p class="firstclass">.....</p>
- foobar some text
- <p class="secondclass">.....</p>
- 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