2015-12-20 56 views

回答

0

$(this).html()得到所有的列標題。

這裏是fiddle

$('#mytable thead tr th').each(function(index) { 
     console.log($(this).html())  
    console.log(index) 
}); 
0

Headers存儲在th,所以你需要去更深一層。

$('#mytable thead tr th').each(function(index) { 
    console.log($(this).html())  
}); 

Fiddle

相關問題