css - Pseudo element content with JQuery -
this question has answer here:
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
Post a Comment