已采纳回答 / 伊兮尘昔
f_oldnode.replaceChild(newnode,oldnode)这句话也改一下 f_oldnode[0].replaceChild(newnode,oldnode)
2015-06-11
http://blog.csdn.net/xiebaochun/article/details/38382169 这个很详细
2015-06-11
最赞回答 / 心宿二
<...code...>因为if判断之前就打印了一遍document.write(text +"<br>");会把空的title也 打印出来。if判断之后又打印了一遍document.write(Lists[i].getAttribute("title")+"<br>");所以title为空的被打印了两遍,第一遍没值,显示为空行,第二遍有你所赋给的值。<...code...>
2015-06-11
已采纳回答 / 伊兮尘昔
是的,你说的不错如果你直接写myarr[i][j]=1;的话,那么每个元素都成1了至于为什么myarr[i][j]=i*j;这么写那是因为i的值一直在变,j的值也在变,所以每个元素都不一样了
2015-06-11
for(var i = 0; i < oTable.tBodies[0].rows.length; i++) {
oTable.tBodies[0].rows[i].onmouseover = function() {
this.style.backgroundColor = "#f2f2f2";
}
oTable.tBodies[0].rows[i].onmouseout = function() {
this.style.backgroundColor = "#fff";
}
}
// 鼠标移动改变背景,可以通过给每行绑定……
oTable.tBodies[0].rows[i].onmouseover = function() {
this.style.backgroundColor = "#f2f2f2";
}
oTable.tBodies[0].rows[i].onmouseout = function() {
this.style.backgroundColor = "#fff";
}
}
// 鼠标移动改变背景,可以通过给每行绑定……
function addRow() {
var oTable, removeBtn;
oTable = document.getElementById("table");
newRow = document.createElement("tr");
newRow.innerHTML = '<td></td><td></td><td><a href="javascript:;">删除</a></td>';
oTable.tBodies[0].appendChild(newRow);
reset();
}
// 编写一个函数,供添加按钮调用……
var oTable, removeBtn;
oTable = document.getElementById("table");
newRow = document.createElement("tr");
newRow.innerHTML = '<td></td><td></td><td><a href="javascript:;">删除</a></td>';
oTable.tBodies[0].appendChild(newRow);
reset();
}
// 编写一个函数,供添加按钮调用……