css - Pseudo element content with JQuery -


i trying change arrow on :after pseudo element

my css

legend:after {     content: url('/html/img/arrow-fieldset-up.png'); } 

i trying change with

$('legend', selected_fieldset).attr('content','url(/html/img/arrow-fieldset-down.png)') 

you cannot select pseudo element jquery. instead can add class css:

legend.selected:after {     content: url('/html/img/arrow-fieldset-down.png'); } 

then add class when want change content, example when click legend:

$('legend').click(function() {     $(this).addclass('selected'); }) 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

c++11 - Intel compiler and "cannot have an in-class initializer" when using constexpr -

python - get cookie expiry time using the requests library -