looping through <tr> then its <td>, is not working.

looping through <tr> then its <td>, is not working.

I tried two different codes but both don't work. Can someone help please?


  1.                $("#table tr").each(function () {

  2.                    $(this).children("td").each(function () {

  3.                        alert($(this).val());
  4.    

  5.                    });

  6.                });
and:
  1.                $("#table tr").each(function () {

  2.                    $(this).find('td').each(function () {

  3.                        alert($(this).val() );
  4.    

  5.                    });

  6.                });
I have textboxes inside of the tds and I'm trying to retrieve its values based on each row.