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 -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -