87,989
社区成员
发帖
与我相关
我的任务
分享


<!doctype html>
<html>
<head>
</head>
<body>
<div id="div1">
<input type="text" style="width:130px" id="input1" title="" >
</div>
<table>
<tr>
<td>
<input type="text" style="width:130px" class="input_c c2" id="bill_covenant_a10000_b1_2" title="" >
</td>
</tr>
</table>
</body>
<script>
window.onload = function(){
var div1 = document.getElementById("div1");
var input1 = document.getElementById("input1");
var select1 = document.createElement("SELECT");
input1.parentElement.insertBefore(select1,input1);
var input2= document.getElementById("input2");
var select2 = document.createElement("SELECT");
input2.parentElement.insertBefore(select2,input2);
};
</script>
</html>
手写了个测试, input1.parentElement.insertBefore(select1,input1); 这个时候就直接报错了 input2.parentElement.insertBefore(select2,input2); 也报相同错误,看了不少td 的问题
bug不多就不是ie了。。
我IE 是这个版本,我用server 2012 的IE 11 测试没这个问题,这是服了