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