Home  >  Article  >  Web Front-end  >  js implements the function code copied to the pasteboard_Basic knowledge

js implements the function code copied to the pasteboard_Basic knowledge

WBOY
WBOYOriginal
2016-05-16 18:27:27999browse

It mainly has two parameters: the first is to set the text to be copied, and the second parameter is to copy the specific content. This content can be obtained from the text box or using innerHTML.
Simple example code:

Copy code The code is as follows:





Note: The ID ctl00_cpRight_txtUrl is actually txtUrl An ID automatically generated after the page is generated.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn