Counting the selectedCell class

Counting the selectedCell class

I'm trying to count the number of selected cells with class="selectedCell" for each row in the following code.


  1. $(function(){
  2.     var output = $('table').find('td.selectedCell').length + ' selected cells';
  3.   $(".tdoutput").html(output);   
  4. });

I have a working example here, but the count shows the same for each row, and instead it shows the total count for the table.