简单的节点问题求教
<html>
<head>
<title> Table Sort Example </title>
<script type= "text/javascript ">
function compareTRs(oTR1, oTR2) {
var sValue1 = oTR1.cells[0].firstChild.nodeValue;
var sValue3 = oTR1.cells[0].innerText;
var sValue4 = oTR1.cells[0].firstChild.innerText;
alert(sValue1);
alert(sValue4);
var sValue2 = oTR2.cells[0].firstChild.nodeValue;
return sValue1.localeCompare(sValue2);
}
function sortTable(sTableID) {
var oTable = document.getElementById(sTableID);
var oTBody = oTable.tBodies[0];
var colDataRows = oTBody.rows;
var aTRs = new Array;
for (var i=0; i < colDataRows.length; i++) {
aTRs[i] = colDataRows[i];
}
aTRs.sort(compareTRs);
var oFragment = &