@@Rolf B
Die textarea selbst kannst Du verstecken, die braucht keiner zu sehen (mit position:absolute; left: -10000px; ins Nirvana verschieben).
😱
Nei-en! Verstecken, ja, aber doch nicht so! Aus Gründen.
Übrigens braucht man die die Textarea nicht zu verstecken, sondern gar nicht.[1]
Man kopiert den generierten String direkt in die Zwischenablage. ☞ Beispiel
In Browsern, die das nicht unterstützen, gibt man den String aus – und zwar nicht in einem Eingabeelement (was textarea
ja ist), sondern in einem Ausgabeelement: output
.
😷 LLAP
--
“When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down ‘happy.’ They told me I didn’t understand the assignment, and I told them they didn’t understand life.” —John Lennon
“When I was 5 years old, my mother always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down ‘happy.’ They told me I didn’t understand the assignment, and I told them they didn’t understand life.” —John Lennon