<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>test</title>
</head><body>
<script>
</script>
<table border=0 >
<tr><td id=t > ddddd</td></tr>
</table>
</body>
</html><script>
function band(){
document.all("t").attachEvent("onmouseover",function(){testd('tete')});
}function testd(str){
document.all("t").innerHTML = "<input>";
alert(str);
}
band();
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>test</title>
</head><body>
<script>
</script>
<table border=0 >
<tr><td id=t > ddddd</td></tr>
</table>
</body>
</html><script>
function band(){
document.all("t").attachEvent("onmouseover",function(){testd('tete')});
}function testd(str){
document.all("t").innerHTML = "<input>";
alert(str);
}
band();
</script>
tr=myTable.insertRow(-1);
td=tr.insertCell(0);
给td如您的方法添加事件不行,提示对象不支持此属性或者方法!
object.attachEvent("onmouseover",function(){...});
document.body.appendChild(object)参考一下,把创建的元素添加到他的父元素中就可以了吧