Is this true?
Yes. Pseudo-elements created with :after
are not part of the DOM and therefore cannot be selected.
Is there anyway around this?
No. Unless you do it without :after
(use an actual element, then you can select it/bind events to it).
Edit
Having re-read your question, I think you're actually asking if you can apply :after
styles to an element with jQuery. The answer is still no, although you can use addClass
to add a new class to the element and define :after
styles for that class name.
Edit again
When I've said "no", it seems I'm not entirely correct... see @AtesGorals answer for a nice workaround.