I want to know is there a way to remove the pseudo ::after. I cant show in code but I have image to explain.
When selecting a checkbox from ::before
a ::after
will be added now What I want is when selecting another checkbox the other checkbox will lose ::after
and will be back to ::before
What I tried is
$('.ckbox label').not(this).removeAttr('::after');
But it is not removing the ::after
I can say that it is not removing because the style is still there
You can't target pseudo elements this way. However you could add a class that sets the content to "none", or add a class and add the pseudo element that way, then just remove the class when you no longer want it.
.added-class:after {
content:none
}
$('.ckbox label').addClass('added-class');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.