How change content value of pseudo :before element by Javascript

后端 未结 8 861
闹比i
闹比i 2020-11-29 23:34

I have the grap constructured by CSS, which is dynamically changes by JS. I show graph max value by pseudo element as:

.graph:before {
    content:\"\"; //va         


        
8条回答
  •  我在风中等你
    2020-11-30 00:36

    You can use document.styleSheets to modify pseudo selector cssRules

    document.styleSheets[0].cssRules[0].style.content = '"111"';
    

提交回复
热议问题