js 实现复制到粘贴板的功能代码_基础知识

WBOY
Release: 2016-05-16 18:27:27
Original
983 people have browsed it

他主要有两个参数:第一个是设置要复制的是一段文本,第二个参数是要复制具体的内容,这个内容可以从文本框中或使用innerHTML获取。
简单的实例代码:

复制代码代码如下:





注:ctl00_cpRight_txtUrl这个ID其实是txtUrl生成页面后自动生成的ID。
Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!