So, I've been trying to find an easy and simple way to access a pseudo CSS class via JavaScript/jQuery but it seems that isn't possible due to those parts not specifically being on the DOM. Essentially, I need help programmatically changing the background
value in the following snippet:
.navbar .link::after {
content: '';
display: block;
margin-top: -13px;
width: 0;
height: 5px;
background: #ffffff;
transition: width .3s;
}
I was trying to do $('.link::after').css('background','gold');
but that did not work. How can I tackle this?
Also, here's the fiddle.