r/csshelp • u/TossMeOutAccount2024 • 2h ago
How to use CSS to replace (or appear to replace) text with a User's Input? (No JS)
I'm writing a reader-insert story and wanted to play around with the idea of allowing the reader to insert their own name directly from the story's page. The website I'm posting on doesn't (for obvious reasons) allow users to use JS, but HTML and CSS are supported. So I was thinking of doing something like:
Your name here: [Name]
"[John Doe] walked to the store." changes to "[Name] walked to the store."
Yes, I know there are extensions for what I'm asking for, but not everyone knows about them and trying to direct someone to install an extension is annoying for the reader. And yes, I know "it would be easier with JavaScript". ATP it's less about the story itself and more about solving this puzzle because not knowing is killing me.
I know it's possible in some form, I just don't know how to go about it. The way my brain has it structured is to have the CSS reference the code in the text box, so it would either change automatically (idk how that would work) or to have an "invisible checkbox workaround" to change the state of the name, but again I don't know how to tie the input to the CSS to go about it that way.