title: How to Get and filter Data attribute of all parents in a nested list, till a target (div) of html element?
body: <p>I've a nested (UL->LI->UL-LI..) list. On any clicked node, I'm using ParentsUntil() to find all the parents till a certain ancestor element. </p>
  
  <p>In each nested element's data attribute (data-weight:), there is number that represent weight. </p>
  
  <p>I want to sum/aggregate total weight till the parent. These numbers (Areas) are in the data-area field of each item. </p>
  
  <pre><code>&lt;ul class="level-1 yes"  data-weight="12" data-weight-total="0"&gt;
    &lt;li class="item-i" data-weight="22" &gt;I&lt;/li&gt;
    &lt;li class="item-ii" data-weight="4"  data-weight-total="0"&gt;II
      &lt;ul class="level-2 yes" data-weight="12"&gt;
        &lt;li class="item-a" data-weight="1.4"&gt;A&lt;/li&gt;
        &lt;li class="item-b" data-weight="128" data-weight-total="0"&gt;B
          &lt;ul class="level-3" data-weight="63" data-weight-total="0"&gt;
            &lt;li class="item-1" data-weight="54"&gt;1&lt;/li&gt;
            &lt;li class="item-2" data-weight="23"&gt;2&lt;/li&gt;
            &lt;li class="item-3" data-weight="107"&gt;3&lt;/li&gt;
          &lt;/ul&gt;
        &lt;/li&gt;
        &lt;li class="item-c" data-weight="231"&gt;C&lt;/li&gt;
      &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li class="item-iii"&gt;III&lt;/li&gt;
  &lt;/ul&gt;
  
  
  
      $( "li.item-2" )
         .parentsUntil( $( "ul.level-1" ), ".yes" );
  </code></pre>
  
  <p>In the list above, </p>
  
  <ol>
  <li>How can I get the an array/list of them items from the clicked item
  to the parent item with their <code>data-weight</code> [key,value]? for e.g. $VarArrayCargoVessel</li>
  <li>And as I traverse up, How can I sum/total weights (data-weight-total) of <em>each</em>/nested list and populate\fill-in the <code>data-weight-total</code>? I have zero's right now, because I dont know how to insert/write into a array value</li>
  </ol>