Loading…
Loading…
JavaScript Frameworks & Libraries
Copy-to-clipboard JavaScript library that needs no framework, by Zeno Rocha.
Visit clipboard.js ↗Selection and execCommand, two browser APIs, do the copying in clipboard.js, which the site lists as supported from Chrome 42, Firefox 41 and Safari 10 onward. Copy buttons are wired up with HTML5 data attributes such as data-clipboard-target, and event delegation saves attaching a listener to each one. Cutting text works only on input and textarea elements. For browsers without support, the site suggests calling ClipboardJS.isSupported() to hide the buttons, or using the error event to tell visitors to press Ctrl+C.
Sources: clipboard.js, clipboard.js on GitHub · Checked 16 Nov 2026