What is your approach in replacing bits of text (usually one or a few
words) for example in links/button that change state of something?
Like, "hide list" you click on it, a list hides, then text should
change to "show list" and vice versa.

Sometimes I put the texts in data-attributes on the element, other
times I have it as option(s) in a class where I store the original and
replace it etc.
Sometimes I just have it hard coded in a class method, once I decided
to store it as content in css with :after...

I mean, it always works, but more often than not I find the
"solutions" a bit weak I don't know..

Reply via email to