0
這是我在這裏:
$('#mytable thead tr').each(function(index) {
//console.log($(this).html())
console.log(index)
});
這是我在這裏:
$('#mytable thead tr').each(function(index) {
//console.log($(this).html())
console.log(index)
});
$(this).html()
得到所有的列標題。
這裏是fiddle
$('#mytable thead tr th').each(function(index) {
console.log($(this).html())
console.log(index)
});
Headers
存儲在th
,所以你需要去更深一層。
$('#mytable thead tr th').each(function(index) {
console.log($(this).html())
});