Because CSS variables are accessible through the DOM, JavaScript can be used to modify them.
This is an illustration of how to write a script that will show and modify the –blue variable from the earlier pages. For the time being, it’s okay if you don’t know anything about JavaScript. See our JavaScript Tutorial for additional information about JavaScript:
Example
Browser Support
The numbers in the table specify the first browser version that fully supports the var() function.