Skip to content

Instantly share code, notes, and snippets.

@iorionda
Created July 31, 2015 04:55
Show Gist options
  • Save iorionda/f20f35b898b9e0744579 to your computer and use it in GitHub Desktop.
Save iorionda/f20f35b898b9e0744579 to your computer and use it in GitHub Desktop.
table のチェックされた行にある指定の要素の件数を合計する
var ary_count = [];
$('.table_body :checked').parents('tr').children('td[id^=id_]').each(function() { ary_count.push(parseInt($(this).text())); });
ary_count.reduce(function(prev, current, i, arr) { return prev + current });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment