Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ` function getDivSum(selector) {
- var sum = 0;
- $(selector).each(function() {
- $(this`enter code here`).children("span").each(function() {
- sum += parseInt($(this).html());
- });
- });
- return sum;
- }
- $(document).ready(function() {
- console.log(getDivSum("#sumDiv"));
- });`
- $(this`enter code here`).children("span").each(function() {
- `$('.parent').each(function(){
- var sum = 0;
- var counts = $(this).find('.count');
- counts.each(function() {
- sum+= parseInt($(this).text());
- });
- console.log(sum);
- });
- `
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement