Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7544367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:39:18+00:00 2026-05-30T08:39:18+00:00

I got with some text entered with tinyMCE in a div class’.category-info’. Text can

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:39:19+00:00Added an answer on May 30, 2026 at 8:39 am

    To wrap all part after hr, I would do something like below,

    var str = $('.category-info').html();
    str = str.split('<hr>');
    
    $('.category-info').html(str[0] + 
              '<div class="news-part">' + 
                 str[1] + 
              '</div>');
    

    DEMO

    If I understood correctly, you want to wrap the element after hr with <div class="news-part" />.. Then try below code,

    $('.category-info hr').next().wrap('<div class="news-part" />');
    

    DEMO

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got some html that looks like this: <div> <span class=red>red text</span> some more
i got these two in the DOM: <div id=buffert> <span class=left><a>link</a><a>link</a></span> <span class=right>Some text<span>title</span></span>
How can I add an image to some text via css? I've got this:
I got some text views and I want to make the buzz effect of
I've got a HTTPHandler which returns either an image or some text and want
I've got the following code: <div onclick=alert('div event'); style=cursor:pointer> some text <a href=asd.php id=link>click</a>
I've got some code like this: <p>Lorem ipsum<a href=# class=a>link</a><span class=b>Text</span>More lorem ipsum<a href=#
I have got some classes .text-1 .text-2 .text-3 I want to select them all,
I got a templated control (a repeater) listing some text and other markup. Each
I have some text area field in my grails application. I got the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.