Bagian TableRowRowIndex Property
Contoh
Klik pada baris yang berbeda untuk mengingatkan posisi mereka:
alert("Section row index is: " + x.sectionRowIndex);
Definisi dan Penggunaan
Properti sectionRowIndex mengembalikan posisi baris dalam kumpulan baris dari <tbody>, <thead>, atau <tfoot>.
Dukungan Peramban
Property | |||||
---|---|---|---|---|---|
sectionRowIndex | Yes | Yes | Yes | Yes | Yes |
Sintaksis
Kembalikan properti sectionRowIndex:
tablerowObject.sectionRowIndex
Detail Teknis
Nilai Kembali: | Angka, mewakili posisi baris dalam kumpulan baris dari tbody, thead, atau tfoot |
---|
Lebih Banyak Contoh
Contoh
Kembalikan posisi baris dalam kumpulan baris thead, tbody, dan tfoot:
var x = document.getElementsByTagName("tr");
var txt = "";
var i;
for (i = 0; i < x.length; i++) {
txt = txt + "The index of Row "+(i+1)+" is: "+x[i].sectionRowIndex+"<br>";
}
Objek TableRow