JavaScript Window getComputedStyle()
JavaScript Window getComputedStyle()
The getComputedStyle() method is used to get the computed CSS properties and values of an HTML element. It returns CSSStyleDeclaration object. The computed style is the style that is applied to the element after all styling sources have been applied.
Syntax:-
Its syntax is:- window.getComputedStyle(element, pseudoElement)
Return:-
Its return is:- CSSStyleDeclaration object having all CSS properties and values of the element
Further Explanation:-
Parameter | Description |
element | Required. The element to get the computed style for. |
pseudoElement | Optional. A pseudo-element to get. |