getPropertyValue
如果我们只能使用一种方法,你能告诉我为什么我们需要使用这种方法getComputedStyle
吗?
例如,据我了解,这将起作用:
var s = getComputedStyle(element, null).opacity;
这相当于以下内容:
var s = getComputedStyle(element, null).getPropertyValue('opacity');
我们可以getComputedStyle
不使用getPropertyValue
吗?