I got with some text entered with tinyMCE in a div class’.category-info’. Text can be splited with hr tag. What I want to do is split the text with jQuery and wrap the second part of the text (after hr tag) into separate div. My code looks like this:
var str = $('.category-info').html();
var splitter = $(str.split('<hr>')[1]).html();
$(splitter).wrap('<div class="news-part" />');
When I alert variable splitter it shows html content (but what’s weired without p tag which is right after hr tag) but it’s not wrapped into div.
To wrap all part after hr, I would do something like below,
DEMO
If I understood correctly, you want to wrap the element after
hrwith<div class="news-part" />.. Then try below code,DEMO