Streaming live at 10am (PST)

Copy to Clipboard Button


#1

I have a feed URL that I want people to copy easily with just one click. Does anyone know the javascript that would allow me to do this? Just a simple copy button with a "copied to clipboard" confirmation statement afterwards, similar to Webflow's read-only link copy button:

Thanks,
Josiah


#2

http://zeroclipboard.org


#3

Hey @samliew, thanks for the link. However, is there not just simple javascript I can use to make a copy button? I looked through the "zeroclipboard" files, and it's around 900KB worth of code.


#4

Unfortunately not. Copy and paste is implemented differently on browsers, plus you also need backward compatibility. That library does all of that for you, and all you need is to implement it.

I have implemented this before at https://samliew.com/nric-generator