var content = document.getElementById("content");
var newInput = document.createElement("input");
newInput.name = "name";
newInput.type = "text";
content.appendChild(newInput);
以上代码在 火狐 和 chrome中都没有问题,但是在IE 8下却不显示:改为
newInput.setAttribute("name", "name");
newInput.setAttribute("type", "text");
还是一样的效果,求解决方法
javascript
input
ie
------解决方案--------------------
试了一下在 ie9的 ie8模式下是可以创建的啊