2015-12-20 5 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

Смежные вопросы