I'm sure this is going to be an easy one. I'm just not seeing a solution in any of the usual places.
I'm getting the number of elements in a table like so: var count = $("#dataset-b tr").length; Then appending that number to a span, like so: $(".count").html("(" + count + ")"); What I want to do is subtract one from that number every time a user clicks a row in the table I'm generating, like so: $("#dataset-b tr").click(function(){ $(this).fadeOut(300); var int = 1; var prod = count - int; $(".count").html("(" + prod + ")"); }); The problem is that it works on the first click (9 changes to 8), but nothing happens on subsequent clicks. Again, I'm sure this is something simple I'm missing. Thanks for any help.