<p id="targetContent">一键复制指定区域的文字</p>
<textarea id="textArea" style="position: fixed;top: 10000px;left: 10000px;opacity: 0;"></textarea>
<button id="clickCopy">复制</button>
$("#clickCopy").bind("click",function(){
var content = $("#targetContent").text();
// 将需要复制的内容赋值给文本框
$("#textArea").val(content);
// 选中文本框的内容
$("#textArea").select();
// 对选中的内容进行复制
document.execCommand("copy");
});