Getting text from td cells with jQuery

后端 未结 5 1495
有刺的猬
有刺的猬 2020-12-11 00:00

I have this code in jQuery:

children(\'table\').children(\'tbody\').children(\'tr\').children(\'td\')

Which gets all table cells for each r

5条回答
  •  失恋的感觉
    2020-12-11 01:07

    You can use .map: http://jsfiddle.net/9ndcL/1/.

    // array of text of each td
    
    var texts = $("td").map(function() {
        return $(this).text();
    });
    

提交回复
热议问题