Copy to clipboard

Is there any way I can make a button copy a text to clipboard? I’ve seen a topic about this but didn’t found a solution. Has someone found one?

It’s one of those code things that seems easy but isn’t.

If recent browser support is sufficient you can place this in the external link field in Sparkle:

javascript:navigator.clipboard.writeText('text');

But the clipboard API isn’t universally available.

1 Like