如何将TABLE>替换成DIV> getElementsByID或者Name取到Table.ParentNode取他父节点然后找 Table所在的子节点(具体哪个根据代码判断)删除然后把<div>加到那个位置就行了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head> <title>FocusTest</title> <script> function newCreate(){ document.getElementById('tbl').removeNode(true); var newDiv =document.createElement('DIV'); newDiv.ID="iDiv"; newDiv.innerText="DIV"; newDiv.style.background="red"; document.body.appendChild(newDiv); } </script></head><body><form><table id="tbl" bgcolor="blue"><tr><td>table</td></tr></table><input type="button" value="切换" onclick="newCreate()"></form></body></html> 得到页面的高度 有没有 ext 4.0下拉树的例子 全的 发个 急急!!!! datalist遍历问题 firefox 与 IE 兼容 javaScript 问题 Jquery中 $( "#id ").before(html) 的疑惑 iframe相关、锚点 [馨郁星愿]js操作字符串~!~~速帮忙~ 如何判断输入的是否为规范的文件路径?包括有目录和没有目录的,有扩展名和没扩展名的等,不能有不允许的字符串。 window.open()的参数,及其意思(在线等) 赋值 javascript minibrowser? 如何判断输入的字符串有多少种类型(数字,大,小写字母,特殊符号)
<html>
<head>
<title>FocusTest</title>
<script>
function newCreate(){
document.getElementById('tbl').removeNode(true);
var newDiv =document.createElement('DIV');
newDiv.ID="iDiv";
newDiv.innerText="DIV";
newDiv.style.background="red";
document.body.appendChild(newDiv);
}
</script>
</head><body>
<form>
<table id="tbl" bgcolor="blue">
<tr><td>table</td></tr>
</table>
<input type="button" value="切换" onclick="newCreate()">
</form>
</body>
</html>