I just stumble on a piece of code which I never saw before:
document.execCommand('Copy');
which seems to copy the clipboard contents to the element in focus.
Is this functionality available cross-browser?
I found a page that shows a compatibility matrix for document.execCommand.