Could you tell me why we need to use the getPropertyValue
method if we can use only the getComputedStyle
one?
For example, this will work,
I believe it is for properties that can't be dot-notationed, like background-position
. Though I suppose that brings up the question "why not use brackets notation, i.e. getComputedStyle(element, null)['background-position']
?". It's possible they just wanted a getter method for the class (CSSStyleDeclaration).