http://expert.csdn.net/Expert/topic/2654/2654542.xml?temp=.458111
解决方案 »
- 层失去焦点后关闭
- [100分]求一个日历式的工作日设置的页面
- 关于arguments的一个奇怪问题
- 如何调用远程页面指定id的div内容?
- [源码]陌生人聊天网站整站源码发布
- 怎样用JS模拟按下alt+空格+x的效果。
- 读取xml页面上某些数据显示在php页面中的js
- 请问如何实现鼠标悬停的时候,显示某标题,或者链接的详细内容啊
- (关于Form的,谢谢!)http://expert.csdn.net/Expert/topic/1506/1506125.xml?temp=.3451502
- 大家帮帮忙,需要源代码:还记得csdn原来的样子嘛,我需要左边那个菜单显示和隐藏的代码
- file控件的浏览按钮时,如何让文件名立刻在其他text控件中显示出来
- 关于disabled的问题
如果你英语好,看看就能懂了table要有id
var onerow=tableid.insertRow(tableid.rows.length);
var onecell=onerow.insertCell();
var twocell=onerow.insertCell();
var threecell=onerow.insertCell();
....
onecell.innerText="...";//文字
twocell.innerHTML="...";//HTML元素,也可是文字
threecell.appendChild(object);//给单元格加对象onerow.attachEvent ('onmouseover', 变色函数名);//上去变色
onerow.attachEvent ('onmouseout', 恢复函数名);//恢复
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY><table id=myTable border=1>
<tr>
<td>AAA</td>
<td>BBB</td>
<td>CCC</td>
</tr>
</table>
<input type="button" value="add row" onClick="foo()">
<script>
function foo(){
var oTr = myTable.firstChild.firstChild.cloneNode(true);
myTable.firstChild.appendChild(oTr);
}
</script>
</BODY>
</HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY><table id=myTable border=1>
<tr flag="old" onMouseOver="moveOver()" onMouseOut="moveOut()">
<td>AAA</td>
<td>BBB</td>
<td>CCC</td>
</tr>
</table>
<input type="button" value="add row" onClick="foo()">
<script>
function foo(){
var oTr = myTable.firstChild.firstChild.cloneNode(true);
oTr.flag = "new";
myTable.firstChild.appendChild(oTr);
}
function moveOver(){
var oTr = event.srcElement;
while(oTr.tagName != "TR"){
oTr = oTr.parentElement;
}
if(oTr.flag == "new")
oTr.style.backgroundColor='blue';
}
function moveOut(){
var oTr = event.srcElement;
while(oTr.tagName != "TR"){
oTr = oTr.parentElement;
}
if(oTr.flag == "new")
oTr.style.backgroundColor='';
}
</script>
</BODY>
</HTML>