JavaScript Window getComputedStyle() Method (original) (raw)

Last Updated : 11 Jul, 2025

The getComputedStyle() method is used to get all the computed CSS property and values of the specified element. The use of computed style is displaying the element after stylings from multiple sources have been applied. The getComputedStyle() method returns a CSSStyleDeclaration object.

Syntax:

window.getComputedStyle(element, pseudoElement)

Parameters:

Example: Return font-family of text in div.

html `

GeeksforGeeks

Try it

The computed font-family of text in the test div is:

`

Output:

JavaScript Window getComputedStyle() Method

JavaScript Window getComputedStyle() Method

Supported Browsers: The browser supported by Window getComputedStyle() Method are listed below:

We have a complete list of HTML and Window methods, to check those please refer to this HTML DOM Complete Reference article