CSS伪元素不是DOM元素,因此你无法直接选择到它们
一个方法是为该元素添加新类,并通过设置新类的属性来达到改变伪元素属性的效果:
.checkboxWrapper.selected::before{
border-left:1px solid white;
border-bottom: 1px solid white;
77%;
height: 40%;
transform: rotate(-45deg);
position: absolute;
left: 13%;
top: 10%;
content:"";
display: block;
opacity: 1;
}
jQuery代码
$(
'.checkboxWrapper'
).addClass(
"selected"
);