You can use document.body.style.setProperty('--name', value);
:
var bodyStyles = window.getComputedStyle(document.body);
var fooBar = bodyStyles.getPropertyValue('--foo-bar'); //get
document.body.style.setProperty('--foo-bar', newValue);//set
More Information here.
More Related Contents:
- required field notification using jquery
- CSS or jQuery : How to get visible top [duplicate]
- How to have html popup appear over main html page?
- Write tags in HTML and print
- Change from (+) symbol to (-) after click (function(){
- How can i create html automatic change page? [duplicate]
- Can jQuery get all CSS styles associated with an element?
- How to disable HTML links
- Cross-browser multi-line text overflow with ellipsis appended within a fixed width and height
- Refresh/reload the content in Div using jquery/ajax
- Animate element to auto height with jQuery
- How to style “input file” with CSS3 / Javascript? [duplicate]
- Show and hide divs at a specific time interval using jQuery
- How do I detect “shift+enter” and generate a new line in Textarea?
- Get a CSS value from external style sheet with Javascript/jQuery
- :touch CSS pseudo-class or something similar?
- CSS3-Animate elements if visible in viewport (Page Scroll)
- Synchronized scrolling using jQuery?
- Open a new javascript window(.open) along with its CSS styling
- How to use javascript conditionally like CSS3 media queries, orientation?
- How to create a responsive image that also scales up in Bootstrap 3
- Toggle visibility property of div
- Check if element is between 30% and 60% of the viewport
- How to check if css value is supported by the browser?
- Add a transform value to the current transforms that are already on the element?
- How do I make a move up and down when I’m scrolling the page?
- How do I detect the inherited background-color of an element using jQuery/JS?
- Why is element not being shown before alert?
- Wrapping lists into columns
- Possible to reverse a css animation on class removal?