My suggestion was that whether or not :before or :after is an element or not is irrelevant. jquery uses CSS selectors for elements. Selecting :before and :after is possible using css , whether or not they are actual elements doesn't really matter, they can still be styled and they still exist as CSS selectors. Since jquery uses CSS selectors, it should be able to select :before and :after elements.
The conversation started with a "should be fairly trivial" but
doesn't have any code. I'd suggest that this be done as a plugin
and then we can look at whether it could/should be pulled into core. If
it required something unusual like creating a new stylesheet on the fly
I think it would be best for it to remain a plugin.