This article describes the simple implementation of JS to copy links. Share it for your reference, as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:///TR/xhtml1/DTD/"> <html xmlns="http:///1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>Click on the Copy link</title> </head> <body> <input type="text" size="30" value="https:///"> <input type="button" value="Copy Link 1" onClick="copyUrl()"> <script type="text/javascript"> function copyUrl(){ var url = ("url").value; ("Text",url); alert("Copy the link successfully!"); } </script> <input type="button" value="Copy Link 2" onClick="();('Copy')"> <br/><br/> I provide two simple ways to copy links,I believe there is always one for you~O(∩_∩)O~ </body> </html>
For more information about JavaScript, readers who are interested in reading this site's special topic:Summary of json operation skills in JavaScript》、《Summary of JavaScript switching effects and techniques》、《Summary of JavaScript search algorithm skills》、《Summary of JavaScript animation special effects and techniques》、《Summary of JavaScript Errors and Debugging Skills》、《Summary of JavaScript data structure and algorithm techniques》、《JavaScript traversal algorithm and skills summary"and"Summary of JavaScript mathematical operations usage》
I hope this article will be helpful to everyone's JavaScript programming.