This article brings you the content is about HTML5 page How to Achieve click Copy function (complete code), there is a certain reference value, the need for a friend can refer to, I hope you have some help.
In the actual work, sometimes encounter such a demand, the page has a link, do not need to check the link content, only need to click the Copy button, you can copy the link content to the Clipboard. This can be achieved by using the Clipboard plugin. Here is a simple demo.
The plugin can be installed first via NPM install clipboard--save-dev.
<! DOCTYPE html>
:
When you finish clicking the Copy button, the successful callback function outputs an object that contains information such as the copied content. At this point, you can paste the Clipboard contents where you want it by using the Paste shortcut in the other places where the text is typed.