StylePropertyMapReadOnly: keys() method
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
The StylePropertyMapReadOnly.keys()
method returns a new
array iterator containing the keys for each item
in StylePropertyMapReadOnly
Syntax
js
keys()
Parameters
None.
Return value
A new Array
.
Examples
In this example we use the keys()
method to be able to access the
properties within our Element.computedStyleMap()
.
js
// get a button element
const buttonEl = document.querySelector("button");
// we can retrieve all computed styles with `computedStyleMap`
const allComputedStyles = buttonEl.computedStyleMap();
// keys returns an iterable list of properties
const props = allComputedStyles.keys();
console.log(props.next().value); // returns align-content
Specifications
No specification found
No specification data found for api.StylePropertyMapReadOnly.keys
.
Check for problems with this page or contribute a missing spec_url
to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
keys |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.