I would like to select the contents of a simple span element, when clicked on
<span
onClick={() => // How do I programmatically highlight the `Click Me!` text?}
>Click Me!</span>
Is there any way to do this?
Edit: I'm sorry it seems the question was not clear enough, I do not only want to highlight the span, but I actually want to trigger a dom selection of the element, so afterwards it can be copied and/or written upon (if for example it is within a div with editable content turned on).