gpt4 book ai didi

javascript 语法在 firefox , IE 中不匹配

转载 作者:太空宇宙 更新时间:2023-11-04 05:18:23 25 4
gpt4 key购买 nike

以下代码适用于 firefox,但在 IE 中显示错误。

document.getElementById('zip_container').style.borderLeft = '1px solid #D9D9D9;';

其中 zip_container 是一个 div。

任何人都可以对此提出任何建议。

最佳答案

无效值 :∀

document.getElementById('zip_container').style.borderLeft = '1px solid #D9D9D9;';

当您使用 style.something 修改样式属性时,“;”不是必需的

但是如果你这样修改它:

document.getElementById('zip_container').style.cssText += ";border-left:1px solid #D9D9D9;";

";"不能丢。所以正确的做法是:

document.getElementById('zip_container').style.borderLeft = '1px solid #D9D9D9';

关于javascript 语法在 firefox , IE 中不匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7280617/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com