0

既知のクラス名を持つテーブル行の ID を取得しようとしています。ajax を使用してデータを取得しています

...

 $.get("getall.php", function(data){       
    {
     $('.tableholder').append(data);
     $('tr:first-child').addClass("current");

次に、最初の子に現在のクラスを与え、それは期待どおりに機能します.ただし、これは未定義を返します

var idcell  = $('table').find('tr.current').attr('id');
     alert(idcell);

undefined が返されるのはなぜですか?

4

1 に答える 1