扫码关注官方订阅号
document.write();把head里的style都写掉了。。
document.write();
head
style
因为用了,document.write,document.write会清除掉所有的doucment的内容,因此你写的style也会被清除掉,你用“审元素”看一下,会发现dom里只有你write的元素了。
document.write
document.write 把原来的网页覆盖了 所以你写的style也就不存在了
你直接用 document.write 把原文档都覆盖 了,你打开你的页面看看,
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
document.write();把head里的style都写掉了。。因为用了,
document.write,document.write会清除掉所有的doucment的内容,因此你写的style也会被清除掉,你用“审元素”看一下,会发现dom里只有你write的元素了。document.write 把原来的网页覆盖了 所以你写的style也就不存在了
你直接用 document.write 把原文档都覆盖 了,你打开你的页面看看,