How to Make Generated Content Selectable

How can I make generated content selectable?

You can't make a pseudo-element selectable, as it doesn't exist in the DOM.

5.10 Pseudo-elements and pseudo-classes

Neither pseudo-elements nor pseudo-classes appear in the document source or document tree.

Find a text generated by content CSS property

It's not possible (unless browser itself has this functionality) because pseudo element are not in DOM. So even with js/jQuery you can't select them

Select text in ::before or ::after pseudo-element

You can't, the before and after pseudo classes are not meant to be used for that purpose.



Related Topics



Leave a reply



Submit