In the browser context, the document node has execCommand method, which has the following syntax: document.execCommand(aCommandName, aShowDefaultUI, aValueArgument) This method can do many magical things, one of which is copying text to the clipboard. For this, simply use "Copy" in place of aCommandName in the syntax mentioned above, like this: …