- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title></title>
- <script type="text/javascript" >
- function creatTab()
- {
- //var event=window.event || arguments.callee.caller.arguments[0];
- //var tabNode=event.srcElement || event.target;
- var tabNode=document.createElement("table");
- var trNode=tabNode.insertRow();
- var tdNode=trNode.insertCell();
- alert(tdNode.nodeName);
- }
- </script>
- </head>
- <body>
- <input type="button" value="创建表格" onclick="creatTab()" />
- </body>
- </html>
- 错误表现:
- firefox运行该页面点击创建表格无效果,IE6则返回TD
- 求解决方法,另外为什么IE10会没效果呢?
复制代码 |