<div>测试内容</div> document.body.oncopy = function () { setTimeout( function () { var text = clipboardData.getData("text"); if (text) { text = text + "\r\n来源:本人博客(http://blog.**.net)"+location.href;//location.href是当前访问路径 clipboardData.setData("text", text); } }, 100 ) }