Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

set css variable from javascript

document.documentElement.style.cssText = "--tab-count: 3";
/or/
document.documentElement.style.setProperty("--tab-count", 5);
/or/
document.documentElement.setAttribute("style", "--tab-count: 5");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #css #variable #javascript
ADD COMMENT
Topic
Name
3+6 =