Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

原生JS实现复制到剪贴板功能 #26

Open
gaochaodd opened this issue Aug 10, 2016 · 0 comments
Open

原生JS实现复制到剪贴板功能 #26

gaochaodd opened this issue Aug 10, 2016 · 0 comments

Comments

@gaochaodd
Copy link

document.execCommand('copy')这行命令足以满足你的需求(注:货号内‘copy’是参数)
猛戳此处查看例子

document.execCommand当然还有很多用法啦,这里简单做一下介绍,详细可参见链接https://developer.mozilla.org/zh-CN/docs/Web/API/Document/execCommand

cut参数,剪切当前选中内容于剪贴板

paste 参数,粘贴剪贴板内容于选中区域

delete参数,删除当前选中内容

@gaochaodd gaochaodd changed the title 原生JS实现复制到剪贴板功能#原生JS##document.execCommand# 原生JS实现复制到剪贴板功能 Aug 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants