This article mainly introduces how to copy the JQueryzClip plug-in to the clipboard and is compatible with all browsers. You can learn from this article. I believe that this feature is frequently used by users on the Internet. I have never noticed how to implement it until it is required in the project.
Final effect:
There are a lot of searches on the Internet, and it is not impossible to simply use the js method, but because of the different security mechanisms of different browsers, It is not cross-browser. I visited several common websites and used transparent flash to block the "Copy to clipboard" button. So when you click "Copy to clipboard", you actually clicked flash, then pass the content you want to copy to flash, and then copy the input content to the Clipboard through the flash copy function.
LoadJQuery library and zclip plugin