function Sort(td)
{
var t=document.getElementById("theList");
var rows=t.getElementsByTagName("td");
var cells=t.cells;
var bb=true;
while(bb==true)
{
alert(bb);
for(var i=1;i<rows.length;i++)
{
if(cells[td.cellIndex+i*4].innerText<cells[td.cellIndex+(i+1)*4].innerText)
{
}
}
alert("Works"); //this alert is not reached
}
}
不会显示第二个警报。你能告诉我为什么吗?
最佳答案
您的 var rows
是一个数组,它没有属性“cells”。那可能就是你的问题。
关于javascript - 虽然不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2836357/