JS implementation of replication compatible with chrome and IE

Source: Internet
Author: User

This article mainly introduces the JS in Chrome and IE under the implementation of replication, the need for friends can refer to the

IE JS Code: Code as follows: <script type= "Text/javascript" > Function CopyUrl2 () {var Url2=document.getelementbyid ("Biao1"); Url2.select (); Select Object Document.execcommand ("Copy"); The Execute Browser Copy command alert ("has been copied well, can be pasted.")  "); } </script> <textarea cols= "rows=" id= "Biao1" > user-defined code area </textarea> <input type= "button" on Click= "CopyUrl2 ()" value= "click Copy Code"/> Chrome JS Code: The code is as follows: <script src= "http://www.weicaiyun.com/assets/js/copy/Ze  Roclipboard.js "></script> <script type=" Text/javascript "> var clip = new Zeroclipboard.client ();  Clip.sethandcursor (TRUE);  Clip.settext (' copy content ');    Clip.glue (' button '); </script> <input type= "button" id= "button" value= "click Copy Code"/>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.