开发者

document.write('<div id="container"') issues in IE7 it closes automatically

开发者 https://www.devze.com 2023-03-25 18:31 出处:网络
h开发者_StackOverflowi i am creating one div in inline Javascript...its closing immidiately in IE7 only remaining browsers will close the tag when we write document.write(\'\')...

h开发者_StackOverflowi i am creating one div in inline Javascript...its closing immidiately in IE7 only remaining browsers will close the tag when we write document.write('')...

document.write('<div id="container" style="position:relative;width:234px;height:160px;overflow:hidden;border:0px;">')


var dynamicDiv = document.createElement("div");
dynamicDiv.id = "container";
dynamicDiv.style.position = "relative";
dynamicDiv.style.width = "234px";
dynamicDiv.style.height = "160px";
dynamicDiv.style.overflow = "hidden";
dynamicDiv.style.border = "0px";
document.body.appendChild(dynamicDiv);

Thats how I perform DOM mutation.

0

精彩评论

暂无评论...
验证码 换一张
取 消