Just a note: I had initially posted an answer to this question yesterday, but I ended up deleting it because I wasn't confident in my understanding of your query. However, after seeing the additional information you provided, I believe that my previous response may actually be what you are looking for. (If it's not the right solution, please do let me know and I'll remove it once again)
Here is an example of what could work:
This snippet should result in the text <span style='display:inline-block; width:0px; overflow:hidden; white-space:nowrap;'>copy me!</span> appearing as random content.
When viewed on a browser, the displayed text should be This is some random text.
. Yet, if copied and pasted into Notepad, it will yield
This is some copy me!random text.
instead.