Copy any text to the clipboard with a 'Copied!' confirmation. Zero dependencies.
A minimal copy-to-clipboard button using the Clipboard API. On success it briefly shows 'Copied!' so the visitor gets feedback. No libraries, works in all modern browsers.
copyBtn.addEventListener("click", () => navigator.clipboard.writeText(text));- Free to use, MIT licensed. No tracking, no backend required unless noted.
- Built by wantedasa.dev. Live preview: https://wantedasa.dev/code-previews/copy-button.html
MIT — do whatever you want, attribution appreciated.