How to copy or paste to/from the clipboard?

Usually this is prohibited do to javascript security restrictions.

Writing to the clipboard

Reading from the clipboard