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 198253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:55:20+00:00 2026-05-11T16:55:20+00:00

I want to use jQuery to dynamically expand my markup so that my divs

  • 0

I want to use jQuery to dynamically expand my markup so that my divs show up as nice rounded boxes.

For example if my DOM has a series of div objects with unique ids like:

<div id="queuediv0" class="isequeue" > </div>

Which can be selected using:

$(“.isequeue”) 

I want to replace/wrap those divs so that the end result looks like:

<div class="isequeue_wrapper">
    <div class="isequeue_wrapper_oc">
        <div class="isequeue_wrapper_dk" style="margin: 0 5px;"> </div>
        <div class="isequeue_wrapper_dk" style="margin: 0 3px;"> </div>
        <div class="isequeue_wrapper_dk" style="margin: 0 2px;"> </div>
        <div class="isequeue_wrapper_dk" style="margin: 0 1px;"> </div>
   </div>
    <p class="isequeue_header">
        Header text
    </p>
    <div class="isequeue_wrapper_ic">
        <div class="isequeue_wrapper_lt" style="margin: 0 5px;"> </div>
        <div class="isequeue_wrapper_lt" style="margin: 0 3px;"> </div>
        <div class="isequeue_wrapper_lt" style="margin: 0 2px;"> </div>
        <div class="isequeue_wrapper_lt" style="margin: 0 1px;"> </div>
    </div>
    <div id="queuediv0" class="isequeue" >
    </div>
     <div class="isequeue_wrapper_oc">
         <div class="isequeue_wrapper_dk" style="margin: 0 1px;"> </div>
         <div class="isequeue_wrapper_dk" style="margin: 0 2px;"> </div>
         <div class="isequeue_wrapper_dk" style="margin: 0 3px;"> </div>
         <div class="isequeue_wrapper_dk" style="margin: 0 5px;"> </div>
     </div>
</div>

The additional markup could be added on the fly or just hidden in the original page so that it can be selected and copied.

I’m sure there is a clean way to accomplish this, but it has eluded me for now. jQuery.wrap() will place the selected objects into the innermost part of the supplied source, but how do you accomplish this when you want the selected item to be a sibling of the newly added source.

Thanks,
Jim

  • 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-11T16:55:20+00:00Added an answer on May 11, 2026 at 4:55 pm

    Something like this could work:

    $(function() {
        var $isqueue = $('.isequeue');
        $isqueue.wrap('<div class="isequeue_wrapper"></div>');
        $isqueue.before(/* All the isequeue_wrapper_oc, isequeue_header, isequeue_wrapper_ic and  stuff */).after(/* All the isequeue_wrapper_ic stuff */);
    });
    

    It would be wise to just have the all the stuff pre-made and then just clone it. But, you could also have them as a string and inserted the same way.

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

Sidebar

Related Questions

so I want to use this JQuery plugin that Stack Overflow has made available
I want to use jQuery tabs ( http://jsfiddle.net/43FcS/2/ ) inside a div that's created
I have a dynamically created UL. I want to use jQuery to use the
I'm just starting out with jQuery and want to use $(document).ready() to dynamically generate
I want to use jQuery to dynamically change an html element every time it's
I want to use jQuery in an add on JS library that can be
I have a form with multiple rows of text boxes. I use jquery .show()
I want to use the jQuery :eq(index) selector dynamically, which means I want to
I want use JQuery mobile for the front-end of my mobile application, but I
I want use jQuery in my project. I know the javascript_include_tag calls the jQuery

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.