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

  • SEARCH
  • Home
  • 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 6903415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:55:22+00:00 2026-05-27T07:55:22+00:00

I need to wrap the div ‘s with the classes .left and .right into

  • 0

I need to wrap the div‘s with the classes .left and .right into a new div. Having problems making this work as I need it to.

This is the original markup:

<div class="content-main">
  <div class="summary" id="listing_summary_3547">
    <div class="share"></div>
    <div class="left"></div>
    <div class="right"></div>
  </div>
  <div class="summary" id="listing_summary_12739">
    <div class="share"></div>
    <div class="left"></div>
    <div class="right"></div>
  </div>        
  <div class="summary" id="listing_summary_4">
    <div class="share"></div>
    <div class="left"></div>
    <div class="right"></div>
  </div>
</div>

This is the result I need:

<div class="content-main">
   <div class="summary" id="listing_summary_3547">
      <div class="share"></div>
      <div class="summary-inside">
         <div class="left"></div>
         <div class="right"></div>
      </div>
   </div>
   <div class="summary" id="listing_summary_12739">
      <div class="share"></div>
      <div class="summary-inside">
         <div class="left"></div>
         <div class="right"></div>
      </div>
   </div>
   <div class="summary" id="listing_summary_4">
      <div class="share"></div>
      <div class="summary-inside">
         <div class="left"></div>
         <div class="right"></div>
      </div>
   </div>
</div>

The script tag needs to reside within in the tags (no access to section). jQuery version is 1.3.2

The closest I am able to get on my own is:

    $('.summary .left,.summary .right').wrapAll('<div class="summary-inside"></div>')

However the result is wrong, the elements get all put together instead of being distributed the way I need them to be.

  • 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-27T07:55:22+00:00Added an answer on May 27, 2026 at 7:55 am

    This is now tested, and does, indeed, work:

    $('.content-main .summary').each(
        function(){
            $(this).find('.left,.right').wrapAll('<div class="summary-inside"></div>');
        });
    

    JS Fiddle demo.

    The text in the linked demo showing the html that you want is the updated html of the .content-main element, after manipulation with jQuery 1.3.2.

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

Sidebar

Related Questions

I need to wrap 3 divs into one using jQuery. <div class=one></div><div class=two></div><div class=three></div>
I need to wrap zend form error messages in custom html. <div class=cerror id=ID-error>
I need to wrap a dynamically allocated array(from a = new double[100] for example)
I need to wrap an iFrame in a div wihtout the iFrame reloading the
I've gotten myself into trouble. This ms my markup: <div class=header_wrap> <div class=header_row0><img src=header-940x60.gif></div>
I need to wrap three divs into one, but that group of three divs
I need to wrap the Validation Summary in a div . How do I
I have an image that I need to wrap in a div: currently doing
I need to create a new div around each block of content after each
I need to wrap a few strings in single quotes for a dynamic TSQL

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.