Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. ` function getDivSum(selector) {
  2. var sum = 0;
  3. $(selector).each(function() {
  4. $(this`enter code here`).children("span").each(function() {
  5. sum += parseInt($(this).html());
  6. });
  7. });
  8. return sum;
  9. }
  10. $(document).ready(function() {
  11. console.log(getDivSum("#sumDiv"));
  12. });`
  13.  
  14. $(this`enter code here`).children("span").each(function() {
  15.  
  16. `$('.parent').each(function(){
  17. var sum = 0;
  18. var counts = $(this).find('.count');
  19.  
  20. counts.each(function() {
  21. sum+= parseInt($(this).text());
  22. });
  23. console.log(sum);
  24. });
  25. `
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement