开发者

Workaround for currentStyle in Safari

开发者 https://www.devze.com 2022-12-13 09:09 出处:网络
Accessing an html element\'s current style u开发者_运维问答sing Element.currentStyle only exists in IE.Is there any easy workaround for Safari or other non-IE browsers?For Safari I can get the current

Accessing an html element's current style u开发者_运维问答sing Element.currentStyle only exists in IE. Is there any easy workaround for Safari or other non-IE browsers?


For Safari I can get the current style using getComputedStyle like this:

window.getComputedStyle(element, null).width;

I found this here.

0

精彩评论

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

关注公众号