IE中给select的innerHTML赋值时的bug
<html xmlns="http://www.w3.org/1999/xhtml" >
<head >
<title>无标题页</title>
<script>
function test()
{
str=“<option>aaaa</option>”;
var a=document.getElementById ("select1");
a.innerHTML=str;
alert(a.innerHTML);//显示“aaaa</option>”
}
</script>
</head>
<body onload="test()">
<form id="form1" >
<select id="select1"><option>aaaaa</option></select>
<input type ="submit" />
</form>
</body>
</html>
<head >
<title>无标题页</title>
<script>
function test()
{
str=“<option>aaaa</option>”;
var a=document.getElementById ("select1");
a.innerHTML=str;
alert(a.innerHTML);//显示“aaaa</option>”
}
</script>
</head>
<body onload="test()">
<form id="form1" >
<select id="select1"><option>aaaaa</option></select>
<input type ="submit" />
</form>
</body>
</html>
官方说明http://support.microsoft.com/kb/276228
浙公网安备 33010602011771号