DEV Community

Mac Dalwin
Mac Dalwin

Posted on

Problem with window.getComputedStyle

So basically this seems weird to me.
Try this in console.

window.getComputedStyle(document. body).getPropertyValue('font-family')

Output: // "Times New Roman"

But

"Times New Roman" === window.getComputedStyle(document. body).getPropertyValue('font-family')

Output: // false

Why?

Additionally, please someone should tell me how to format code block on dev.to, I'm fairly new to the community

Top comments (1)

Collapse
 
kayrag profile image
Kayra Güneş
"\"Times New Roman\"" ===
window.getComputedStyle(document. body).
getPropertyValue('font-family')

and use three times ` to format code