<
JavaScript 复制内容到剪贴板
>
上一篇

了解 Web 前端的工作内容
下一篇

jQuery 笔记
完美兼容各种浏览器
苏轻最后编辑于 2019 年 01 月 21 日 23:20:46
function copyText(value) {
	var textarea = document.createElement('textarea');
	textarea.value = value;
	document.body.appendChild(textarea);
	textarea.select();
	document.execCommand("Copy");
	textarea.style.display = 'none'; // 不显示
	alert('已经复制到剪贴板!');
	console.log("Copy successfully.");
}
Top
Foot