js修改css伪类after、before中的content

81 阅读1分钟

` .count { color: blur; } .count::after { content: attr(data-content); color: red; }

`

利用 css 中的 attr() 方法,获取标签中的属性,来实现动态修改伪类中的content值