by eksith · 13y ago · 0 comments
My suggestion, expanding on what they do, is to not to try to copy anything to the user's clipboard and instead highlight the content (I'd advise against the hidden textarea too though). On mobile devices especially, highlighting is still a bit of a pain with large amounts of text.
http://stackoverflow.com/questions/11128130/select-text-in-j...
Leave copying to the user. As an added benefit, you're not relying on browser hacks (IE only or otherwise) or flash.
In this case, it's an actionable (command only) element that's inaccessible directly; the same as a tooltip or popup that hasn't shown itself yet. However, even in the case of a tooltip or popup, they will eventually show themselves to the user. A completely hidden anything IMO introduces a layer of obfuscation to what's actually happening to the DOM and on the page.
It's a bit "hackish".
It's definitely hackish, though. :)