Free tools Windows power users keep installed
One-click scans. No signup required.
For new code, use the browser’s asynchronous Clipboard API—navigator.clipboard.writeText()—from a user action, and handle failures. jQuery can attach the button’s event handler, but jQuery itself does not write to the system clipboard. The other three options are a deprecated browser command, a convenience library built on that command, and a Flash-based approach that is obsolete.
Which jQuery copy-to-clipboard option should you use?
| Option | Best fit | Key limitation |
|---|---|---|
| Asynchronous Clipboard API | New browser code that copies plain text | Availability and permission behavior vary by browser and context; handle rejected writes. W3C Clipboard API and events |
document.execCommand('copy') |
Understanding or maintaining legacy code | Deprecated and not on track to become a standard. MDN: Document.execCommand() |
| clipboard.js | An existing project that already uses the library | Its documented implementation relies on Selection and execCommand. clipboard.js |
| ZeroClipboard / jquery.zeroclipboard | Maintaining an old Flash-dependent project | Requires Flash; the jQuery plugin repository was archived on February 16, 2021. jquery.zeroclipboard repository |
For ordinary text, the native API is the clearest starting point. Rich clipboard formats can use ClipboardItem where supported, but format support and permissions need checking in the browsers your application targets. The W3C specification describes user-agent protections that may require focus, permission, or a user gesture; do not assume a write will succeed from every context.
1. Use the asynchronous Clipboard API for new code
Call navigator.clipboard.writeText(text) in response to a user action such as clicking a copy button. It returns a promise: show success only after it resolves, and provide an honest failure message if it rejects or the API is unavailable. jQuery can wire up the click event, while the clipboard write itself is provided by the browser.
const $copyButton = $('#copy-button');
const textToCopy = $('#text-to-copy').text();
$copyButton.on('click', async function () {
if (!navigator.clipboard?.writeText) {
showCopyFailure('Clipboard access is unavailable here.');
return;
}
try {
await navigator.clipboard.writeText(textToCopy);
showCopied();
} catch (error) {
showCopyFailure('Could not copy. Select and copy the text manually.');
}
});
This is an illustrative pattern, not a guarantee for every browser or embedding. Keep the user action directly connected to the write, and test in the origins, browsers, and frames your app supports. If the promise rejects, do not display a success state; offer a usable alternative such as selectable text and a manual-copy instruction.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
What jQuery does—and does not do
jQuery can select the source element, read its text, register a click handler, and update status text. It does not supply a system clipboard API. Its “copying” API category concerns copying DOM elements, not copying their contents to the operating system clipboard. jQuery API: Copying
2. Treat document.execCommand('copy') as legacy
Older implementations often selected text in a temporary element and called document.execCommand('copy'). MDN marks execCommand() deprecated and says it is no longer on track to become a standard. It may matter when reading or maintaining older code, but it should not be presented as the modern default or as guaranteed to work. MDN: Document.execCommand()
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Using a library that wraps this command does not remove the underlying legacy dependency. If you retain an old implementation, test it in the specific environments you support and ensure the UI can explain failure rather than claiming that the text was copied.
3. Consider clipboard.js only when its trade-offs fit
clipboard.js provides selector-based setup, data attributes, imperative target or text callbacks, and success and error events. Its documentation says it relies on Selection and execCommand, so it is a convenience layer rather than a replacement for the browser’s newer clipboard API. clipboard.js project site
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
const clipboard = new ClipboardJS('.btn');
clipboard.on('success', function (event) {
showCopied();
event.clearSelection();
});
clipboard.on('error', function () {
showCopyFailure('Could not copy. Select and copy the text manually.');
});
The project site publishes a historical browser-support list: Chrome 42+, Edge 12+, Firefox 41+, Internet Explorer 9+, Opera 29+, and Safari 10+. Treat that as the project’s published list, not a verified current compatibility promise. Check current maintenance, requirements, and behavior against your own supported browsers before choosing the library for new work.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.4. Keep ZeroClipboard as a historical maintenance case
The jquery.zeroclipboard plugin integrates with ZeroClipboard v2.x through custom beforecopy, copy, aftercopy, and copy-error events. It requires Flash Player 11 or higher. ZeroClipboard used an invisible Flash movie positioned over the clicked element to perform the copy. jquery.zeroclipboard repository · ZeroClipboard instructions
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
The plugin repository was archived on February 16, 2021. Because this approach depends on retired Flash technology, use it only to understand or maintain old systems—not for a current web page.
Quick Recap
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
How to choose and verify your implementation
- Building a new copy button: use
navigator.clipboard.writeText()in the click handler and handle both success and rejection. - Maintaining an older page: identify whether it calls
execCommanddirectly or through clipboard.js, then verify its behavior in the browsers and contexts you still support. - Supporting varied browsers or embedded pages: check API availability and test permission, focus, and user-gesture behavior in the actual deployment context; do not infer universal support from an old library list.
- Encountering ZeroClipboard: treat it as a Flash-era dependency to replace when feasible, not as an option for a new implementation.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

