JS Realize the mobile end click button Copy the text content

The mobile terminal click button copy text content, as shown below:

 Invitation code  // 
{{{ INVITE_CODE}}

Copy

Copy () {var URL2 = this.invite_code; // var oinput = document.createElement ("Input"); var oinput = document.getlementbyid ("invitecode"); // oinput.value = url2; // Document.body.Appendchild (OINPUT); OInput.select (); // Select Object //Document.execcommand ("cut ", "false", Nunull ); // Execute the browser cut command document.execcommand ("copy"); // Execute the browser copy command //oinput.classname = "oinput"; // oinput.style.display = "none"; Alert "Copy Success"); // Console.log (Document.execCommand ("Copy"))} ("copy"))}},

Summary
The above is the JS implementation of the small series to realize the mobile terminal click button to copy the text content. I hope that everyone will help. If you have any questions, please leave a message in time, Xiaobian will reply to everyone. Thank you very much for your support of Tumi Cloud Website! If you think this article helps you, welcome to reprint, please indicate the source, thank you!

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment