How to get and set CSS variable property values.

suggest change

To get a value use the .getPropertyValue() method

element.style.getPropertyValue("--var")

To set a value use the .setProperty() method.

element.style.setProperty("--var", "NEW_VALUE")

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Get and set CSS custom variables:
*How to get and set CSS variable property values.

Table Of Contents
16Map
17Set
104Get and set CSS custom variables