Jquery.length

Jquery.length

Hi All,

I'm a jquery newbie and I don't understand the solution for my problem.

I have a simple table with 1 header and 4 rows in the body.

I created a page with 1 table and 3 buttons ( 1 with "insertAfter" and 1 with "insertBefore" methods ) the third button has :
  1.       $('#bDelRow').click( function()
  2.       {
  3.         alert( $('#celebs tbody tr').length );
  4.       });
Even if I insert a new row before or after in the tbody the alert show me always "4"!

I found this "https://api.jquery.com/length/" where the length work fine!

can someone help me?

thanks,
D.