rafaelmaeuer
1/3/2017 - 5:16 PM

Add Pseudo Element Styles with JavaScript From http://pankajparashar.com/posts/modify-pseudo-elements-css/

Add Pseudo Element Styles with JavaScript From http://pankajparashar.com/posts/modify-pseudo-elements-css/

// just add rule
document.styleSheets[0].addRule('.red::before','color: green');
// or insert rule at index 0 to remove it later
document.styleSheets[0].insertRule('.red::before { color: green }', 0);