js修改伪类的值

css文件

p.change:after {
    content: attr(data-content);
}

js文件

$(this).addClass('change').attr('data-content', content);
原文地址:https://www.cnblogs.com/lrxsblog/p/6255768.html