<div class="techbrood" id="td_pseudo">techbrood introduction</div>和CSS代码:
.techbrood:before {width: 0;}现在你想在某个元素的click事件中动态的把techbrood:before的width属性设置为100%,$("head").append("<style>.techbrood::before{ width:100% }</style>");(注意该方法将影响所有的class为techbrood的元素).techbrood.change:before{width: 100%;}jQuery代码:$("#td_pseudo").addClass("change");