0
function highlightRow(searchRow)
{
if(searchRow != null)
{
var oRows = document.getElementById('Table').getElementsByTagName('tr');
//use row number to highlight the correct HTML row.
var lastTwo = searchRow;
lastTwo = lastTwo.slice(-2); //extract last two digits
oRows[lastTwo].style.background="#90EE90";
}
}
我得到了100行的分頁。JavaScript如何解釋索引?
當searchRow返回55時,突出顯示第55行。
當searchRow返回177時,我突出顯示第77行,因此爲切片函數。
現在問題:
當searchRow返回03或201時,oRows []上的索引不起作用。
這是爲什麼?
迷惑了我更多的時候我硬編碼「03」,它的工作:
oRows[03].style.background="#90EE90";
任何深入瞭解如何工作的?
jQuery是否有這個問題?
謝謝。
'的jQuery '**是** JavaScript,但反之亦然。 – 2010-09-15 19:06:36