1

I have the following HTML elements:

<p>Content here</p>
<div class="pagebreak"></div>
  Sometext
<span style="somestying"><strong>Title</strong></span>
...and many more content.

Using below JQuery code, I'm trying to select all nodes after the the node with class pagebreak

var findPagebreak = $(currentPagina[0]).find('.pagebreak');
var nextContent = $(findPagebreak).nextAll();

But the variable nextContent only contains node:

<span style="somestying"><strong>Title</strong></span> 

I would like to take select the text nodes and all html elements after the div with pagebreak class.

Anyway I could do this?

Jeff
  • 11
  • 3
  • Does this answer your question? [How do I select text nodes with jQuery?](https://stackoverflow.com/questions/298750/how-do-i-select-text-nodes-with-jquery) – Andy Ray Jan 16 '23 at 03:27
  • Not really, im trying to move the html nodes and tekst nodes to a new div onces i do that it has lost all its styling for some reason. – Jeff Jan 16 '23 at 04:54
  • Based on your example .nextAll() would take the content you said it does, and any siblings that follow. But it seems you're also saying you're losing your css styling after moving it? That sounds like a second challenge, correct? – WhatsYourFunction Jan 16 '23 at 07:11
  • Correct, but i managed to resolve the issue with another function with a split so i split the contents before i do any jquery stuff. return src.split(/\
    /); Therefor i could make the div's needed.
    – Jeff Jan 16 '23 at 16:46

0 Answers0