<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 ) }