var op = document.createElement("p");
op.setAttribute("style","width:100px;height:100px;backgroundColor:#606060");
这个在IE7以下好像不能创建p;这是为什么?
如果我这样跟p添加样式:
op.width="200px";
op.height="100px";
op.backgroundColor="#606060";
在IE7以下虽然能创建p,但是它在页面中不会显示p这个标签,求解决方法,谢谢
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
你append了?
因为IE6.7不支持object.setAttribute()这样的写法,可以改为object.style.cssText =“XXX”