JS 获取元素当前的样式信息

1 HTMLElement.prototype.__defineGetter__("currentStyle", function () {
2     return this.ownerDocument.defaultView.getComputedStyle(this, null);
3 });

example:

1 document.body.currentStyle['width']
原文地址:https://www.cnblogs.com/mahatmasmile/p/3267699.html