How can I concatenate Data inside a div to a string with multiple divs in a div?
<p>I have an application, where I have a div and Add Column Button, when I click on Add Column Button, columns are added inside the div. Now what I want to do is there are some elements like <code>&lt;ol&gt;</code> and <code>&lt;li&gt;</code> in that div columns and I want to concatenate them into string separately for each div, how can I do this?</p>

<p>This is how my columns in my div looks:</p>

<pre><code>&lt;div id="columnholder"&gt;

    &lt;div class="shoppingCart" id="shoppingCart1"&gt;
    &lt;h2 class="ui-widget-header"&gt;Add Menu Items Here &lt;img onclick="removecolumn(this.id)" style="float: right; cursor:pointer;" id="shoppingCart1" src="../Images/delete.png"&gt;&lt;/h2&gt;
    &lt;aside id="droppable" class="ui-widget-content"&gt;
    &lt;ol class="ui-droppable"&gt;
      &lt;li&gt;Brand1
          &lt;ol class="ui-droppable"&gt;
              &lt;li&gt;Add Sub Menu here&lt;/li&gt;
               &lt;li&gt;Category2
                  &lt;ol class="ui-droppable"&gt;
                     &lt;li&gt;Add Sub Menu here&lt;/li&gt;
                     &lt;li&gt;Product2
                        &lt;ol class="ui-droppable"&gt;
                             &lt;li&gt;Add Sub Menu here&lt;/li&gt;
                                &lt;li&gt;Product4
                                  &lt;ol class="ui-droppable"&gt;
                                       &lt;li&gt;Add Sub Menu here&lt;/li&gt;
                                             &lt;li&gt;Product3
                                                &lt;ol class="ui-droppable"&gt;
                                                   &lt;li&gt;Add Sub Menu here&lt;/li&gt;
                                                       &lt;li&gt;Product3
                                                         &lt;ol class="ui-droppable"&gt;
                                                            &lt;li&gt;Add Sub Menu here
                                                              &lt;/li&gt;
                                                          &lt;/ol&gt;
                                                     &lt;/li&gt;
                                                &lt;/ol&gt;
                                          &lt;/li&gt;
                                    &lt;/ol&gt;
                              &lt;/li&gt;
                        &lt;/ol&gt;
                   &lt;/li&gt;
              &lt;li&gt;Product2
                 &lt;ol class="ui-droppable"&gt;
                         &lt;li&gt;Add Sub Menu here&lt;/li&gt;
                              &lt;li&gt;Product4&lt;ol class="ui-droppable"&gt;
                                    &lt;li&gt;Add Sub Menu here&lt;/li&gt;
                                         &lt;li&gt;Product4
                                             &lt;ol class="ui-droppable"&gt;
                                                   &lt;li&gt;Add Sub Menu here&lt;/li&gt;
                                                          &lt;li&gt;Product4
                                                             &lt;ol class="ui-droppable"&gt;
                                                               &lt;li&gt;Add Sub Menu here 
                                                                  &lt;/li&gt;
                                                               &lt;li&gt;Product4
                                                                  &lt;ol class="ui-droppable"&gt;
                                                                        &lt;li&gt;Add Sub Menu here&lt;/li&gt;
    &lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/aside&gt;&lt;/div&gt;


    &lt;div class="shoppingCart" id="shoppingCart2"&gt;

    //data like above         

    &lt;div&gt;

    // there may be number of columns

    &lt;/div&gt;
</code></pre>

<p>What I want is to concatenate them to string separately like data in "shoppingcart1" div should be concatenated differently and same for other divs in the column holder div can any one help me here please. How can I do this?</p>
