How to add up the numbers in div?

Hi all.
This question:
I have a ul > li > p, div
How to find sum of numbers in a div?
P. S. new div will enter the input ( now it's not so important).

5a914b7a5a334715227731.png
June 7th 19 at 15:45
1 answer
June 7th 19 at 15:47
Solution
$(function(){
var sumDiv = 0;
$('li div').each(function(){
var html = $(this).text() ;
sumDiv += Number(html);
});
console.log(sumDiv);
});
thanks) - fredrick_Walsh commented on June 7th 19 at 15:50

Find more questions by tags JavaScriptjQuery