Avatar of Techsavy
Techsavy
 asked on

JQuery selection help

Hi,

Attached is my DOM.
 
What I am trying to do is group a set of selected divs and wrap them into another div.

so far I was able to wrap all cost Divs by using:

 $(document).ready(function () {

        $('.ewa-ptp-parameters > div:lt(14)').wrapAll("<div id='CostBlock' style='border:1px solid red;'></div>");

      });


This works fine. However, I want to next select 14th direct child of ewa-ptp-parameters

and wrap them into another div

so I tried:

      $('.ewa-ptp-parameters > div:eq(15)').wrapAll("<div id='ProcessFlowBlock' style='border:1px solid green;'></div>");

This does not work for some reason.

Also likewise I want to select all the process divs and group them and wrap and same thing for Reuse and so on.


How do I achieve this?

Please help.
GeneratedDom.txt
jQuery

Avatar of undefined
Last Comment
Rainer Jeschor

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Rainer Jeschor

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.
fblack61