/*this is the link that all comments display at the end*/ <a onclick='CopyToClipboard(/*copying to clipboard any element determined by id i put in here*/)'>Copy comment</a> /*this is the function it calls on click*/ <script> //<![CDATA[ function CopyToClipboard(containerid) { if (window.getSelection) { if (window.getSelection().empty) { // Chrome window.getSelection().empty(); } else if (window.getSelection().removeAllRanges) { // Firefox window.getSelection().removeAllRanges(); } } else if (document.selection) { // IE? document.selection.empty(); } if (document.selection) { var range = document.body.createTextRange(); range.moveToElementText(document.getElementById(containerid)); range.select().createTextRange(); document.execCommand("copy"); } else if (window.getSelection) { var range = document.createRange(); range.selectNode(document.getElementById(containerid)); window.getSelection().addRange(range); document.execCommand("copy"); } } //]]> </script> </body> /*and this is how the id of any comment is determined, this is a default blogger thing*/ <dd class='comment-body' expr:id='data:widget.instanceId + data:comment.cmtBodyIdPostfix'>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)