The Element.computedStyleMap() method returns a StylePropertyMapReadOnly — a read-only map of the element’s computed CSS as CSS Typed OM values (MDN). It is an alternative to getComputedStyle(), which returns resolved string values.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call el.computedStyleMap. Start with this line.
JavaScript
el.computedStyleMap()
Call
What it does
el.computedStyleMap()
Primary signature.
el.computedStyleMap(...)
Call with the arguments your case needs.
Built into the browser. Call computedStyleMap(...) on an Element — no import required.
Library declarations
JavaScript
el.computedStyleMap()
Parameters
This member has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
StylePropertyMapReadOnly
JavaScript Examples
Example 1 — Read One Property
Get a typed computed value with map.get().
JavaScript
const el = document.getElementById("box");
const out = document.getElementById("out");
const map = el.computedStyleMap();
out.textContent = String(map.get("color"));
Test the method.typeof … === "function" is enough.
Happy path. Use Typed OM when present.
Fallback.getComputedStyle works almost everywhere.
Same intent. Both paths expose a color you can show as text.
Compatibility
Browser Support
Element.computedStyleMap() is Limited availability on MDN (not Baseline). Chromium engines have long supported it; Safari from 16.4+; Firefox support is recent. Feature-detect and fall back to getComputedStyle().
✓ Limited availability
Element.computedStyleMap()
CSS Typed OM computed styles — use getComputedStyle() as a portable fallback.
—Limited
Google Chrome66+
Supported
Microsoft Edge79+
Supported
Opera53+
Supported
Apple Safari16.4+
Supported
Mozilla FirefoxRecent / verify target
Partial
Internet ExplorerNot supported
Unavailable
computedStyleMap()Limited
Bottom line: Detect typeof el.computedStyleMap === "function". Prefer Typed OM when you need computed (not resolved) values; otherwise getComputedStyle() is the safe default.
Frequently Asked Questions
It returns a StylePropertyMapReadOnly — a read-only map of computed CSS properties on the element (MDN). Values are CSS Typed OM objects, not plain strings like getComputedStyle().
No. MDN lists it on the CSS Typed OM standard track with Limited availability (not Baseline). It is not marked Deprecated, Experimental, or Non-standard on MDN.
getComputedStyle() returns resolved values as strings (often pixels after layout). computedStyleMap() returns computed values as typed objects — for width: 50%, computed may stay 50% while resolved becomes pixels (MDN).
No. Call el.computedStyleMap() with no arguments.
Use map.get("property-name"), for example styles.get("color"). The result is a typed CSS value — coerce with String() for display if needed.
Feature-detect with typeof el.computedStyleMap === "function" and fall back to getComputedStyle() for portable string reads.