javascript - Trouble getting count of table rows that contain certain text -


i trying output count of table rows contain text label.

when step through javascript, count variable contains count, ends value of undefined when stepping next line.

var lblpending = document.getelementbyid("lblpending"); var count = $("#match-table tr").filter(function() { return $.text([this]) === 'pending credit'; }).length;   if (count > 0) { lblpending.innerhtml = count + " pending"; } else { $("#lblpending").hide(); } 

is return causing that?

something this(using contains):

$(function(){    var myrows = $("#match-table tr:contains('pending credit')");    $("#result").html(myrows.length + " pending"); }); 

working fiddle: https://jsfiddle.net/robertrozas/rdesdnqm/


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -