Home » Php » javascript – Sum of specific value within elemtents in a droppable list

javascript – Sum of specific value within elemtents in a droppable list

Posted by: admin February 25, 2020 Leave a comment

Questions:

I have 2 droppable lists.
The dragged Elements contain several SPAN elements:
Name, Titel & 1-n movements:

<li class="sortList" id="48">
<span>Name</span><br>
<span><b>César Franck</b></span>
<span><br> Sonate in A-Dur</span><br>
<span>Allegretto ben moderato</span><span data-minutes="7"> (7 Min.)</span><br><span>Allegro</span><span data-minutes="8"> (8 Min.)</span>
<br><span></span>
</li>

Each movement has a lenght in minutes.

Lets say I have two columns:
first contains all elements
second is empty at first

I now want do display ondrop the sum of the minutes of all elements that are dragged to the second column.

Any suggestions?
Thanks a lot!

How to&Answers: