javascript - Find if checkbox is cheked in tr -


i have problem determining if checkbox checked in parent tr. if checkbox cheked tr shoud skiped. seemed correct in code,but it's not working.

$(document).ready(function () {     var sum = 0;     $('#maincontent_gvorders > tbody > tr > td .col1').each(function () {         if ($(this).closest('tr').has('input:not(:checked)')) {             sum += parseint($(this).text());         }     });     $('#tp').html(sum); });  function pageload(sender, args) {     var sum = 0;     $('#maincontent_gvorders > tbody > tr > td .col1').each(function () {         if ($(this).closest('tr').has('input:not(:checked)')) {             sum += parseint($(this).text());         }     });     $('#tp').html(sum); } 

you can using below code.

$('#maincontent_gvorders  tr:has("input:not(:checked)")').filter(function(){      return sum += parseint($(this).find('td').text(), 10); }); 

demo


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -